<template>
  <div class="threed-container min-h-screen bg-gradient-to-br from-blue-50 to-indigo-50">
    <!-- 顶部应用栏 -->
    <div class="threed-app-bar">
      <div class="container mx-auto px-4 py-3 flex items-center justify-between">
        <div class="flex items-center">
          <Menu class="w-5 h-5 text-blue-600 mr-4" />
          <h1 class="text-xl font-medium text-blue-900">3D Design</h1>
        </div>
        <div class="flex items-center space-x-4">
          <button class="threed-icon-button">
            <Search class="w-5 h-5" />
          </button>
          <button class="threed-icon-button">
            <Bell class="w-5 h-5" />
          </button>
          <button class="threed-icon-button">
            <User class="w-5 h-5" />
          </button>
        </div>
      </div>
    </div>

    <!-- 主要内容区 -->
    <div class="container mx-auto p-6">
      <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
        <!-- 左侧导航 -->
        <div class="threed-card">
          <div class="p-4">
            <h2 class="text-lg font-medium mb-4 text-blue-900">导航菜单</h2>
            <nav class="space-y-2">
              <a href="#" class="threed-nav-item active">
                <Home class="w-5 h-5" />
                <span>首页</span>
              </a>
              <a href="#" class="threed-nav-item">
                <Inbox class="w-5 h-5" />
                <span>收件箱</span>
                <span class="threed-badge">12</span>
              </a>
              <a href="#" class="threed-nav-item">
                <Star class="w-5 h-5" />
                <span>收藏</span>
              </a>
              <a href="#" class="threed-nav-item">
                <Settings class="w-5 h-5" />
                <span>设置</span>
              </a>
            </nav>
          </div>
        </div>

        <!-- 中间内容 -->
        <div class="md:col-span-2 space-y-6">
          <!-- 卡片列表 -->
          <div class="threed-card">
            <div class="p-4">
              <h2 class="text-lg font-medium mb-4 text-blue-900">卡片列表</h2>
              <div class="space-y-4">
                <div class="threed-list-item">
                  <div class="threed-avatar bg-blue-500">JD</div>
                  <div class="flex-1">
                    <h3 class="font-medium text-blue-900">卡片标题</h3>
                    <p class="text-blue-600">卡片副标题</p>
                  </div>
                  <button class="threed-icon-button">
                    <MoreVertical class="w-5 h-5" />
                  </button>
                </div>
                <div class="threed-list-item">
                  <div class="threed-avatar bg-indigo-500">AB</div>
                  <div class="flex-1">
                    <h3 class="font-medium text-blue-900">另一个标题</h3>
                    <p class="text-blue-600">另一个副标题</p>
                  </div>
                  <button class="threed-icon-button">
                    <MoreVertical class="w-5 h-5" />
                  </button>
                </div>
              </div>
            </div>
          </div>

          <!-- 表单元素 -->
          <div class="threed-card">
            <div class="p-4">
              <h2 class="text-lg font-medium mb-4 text-blue-900">表单元素</h2>
              <div class="space-y-4">
                <div class="threed-input-group">
                  <label class="text-blue-700">文本输入</label>
                  <input type="text" placeholder="请输入内容" class="threed-input">
                </div>
                <div class="threed-input-group">
                  <label class="text-blue-700">密码输入</label>
                  <input type="password" placeholder="请输入密码" class="threed-input">
                </div>
                <div class="threed-input-group">
                  <label class="text-blue-700">下拉选择</label>
                  <select class="threed-input">
                    <option>选项 1</option>
                    <option>选项 2</option>
                    <option>选项 3</option>
                  </select>
                </div>
                <div class="flex items-center space-x-4">
                  <label class="threed-checkbox">
                    <input type="checkbox">
                    <span class="threed-checkmark"></span>
                    <span class="text-blue-700">复选框</span>
                  </label>
                  <label class="threed-radio">
                    <input type="radio" name="radio">
                    <span class="threed-radiomark"></span>
                    <span class="text-blue-700">单选框</span>
                  </label>
                </div>
                <div class="threed-switch">
                  <input type="checkbox" id="switch1">
                  <label for="switch1" class="text-blue-700">开关</label>
                </div>
              </div>
            </div>
          </div>

          <!-- 按钮组 -->
          <div class="threed-card">
            <div class="p-4">
              <h2 class="text-lg font-medium mb-4 text-blue-900">按钮样式</h2>
              <div class="flex flex-wrap gap-4">
                <button class="threed-button">主要按钮</button>
                <button class="threed-button outlined">次要按钮</button>
                <button class="threed-button text">文本按钮</button>
                <button class="threed-button icon">
                  <Plus class="w-5 h-5" />
                </button>
              </div>
            </div>
          </div>

          <!-- 进度指示器 -->
          <div class="threed-card">
            <div class="p-4">
              <h2 class="text-lg font-medium mb-4 text-blue-900">进度指示器</h2>
              <div class="space-y-4">
                <div class="threed-progress">
                  <div class="threed-progress-bar" style="width: 60%"></div>
                </div>
                <div class="threed-progress circular">
                  <div class="threed-progress-circle"></div>
                </div>
              </div>
            </div>
          </div>

          <!-- 对话框 -->
          <div class="threed-card">
            <div class="p-4">
              <h2 class="text-lg font-medium mb-4 text-blue-900">对话框示例</h2>
              <button class="threed-button" @click="showDialog = true">打开对话框</button>
            </div>
          </div>
        </div>
      </div>
    </div>

    <!-- 底部导航栏 -->
    <div class="threed-bottom-nav">
      <a href="#" class="threed-bottom-nav-item active">
        <Home class="w-6 h-6" />
        <span>首页</span>
      </a>
      <a href="#" class="threed-bottom-nav-item">
        <Search class="w-6 h-6" />
        <span>搜索</span>
      </a>
      <a href="#" class="threed-bottom-nav-item">
        <Plus class="w-6 h-6" />
        <span>添加</span>
      </a>
      <a href="#" class="threed-bottom-nav-item">
        <Bell class="w-6 h-6" />
        <span>通知</span>
      </a>
      <a href="#" class="threed-bottom-nav-item">
        <User class="w-6 h-6" />
        <span>我的</span>
      </a>
    </div>

    <!-- 对话框 -->
    <div v-if="showDialog" class="threed-dialog-overlay">
      <div class="threed-dialog">
        <div class="threed-dialog-header">
          <h3 class="text-blue-900">对话框标题</h3>
          <button class="threed-icon-button" @click="showDialog = false">
            <X class="w-5 h-5" />
          </button>
        </div>
        <div class="threed-dialog-content">
          <p class="text-blue-600">这是一个 3D 风格的对话框示例。</p>
        </div>
        <div class="threed-dialog-actions">
          <button class="threed-button text" @click="showDialog = false">取消</button>
          <button class="threed-button" @click="showDialog = false">确定</button>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { 
  Menu, Search, Bell, User, Home, 
  Inbox, Star, Settings, MoreVertical,
  Plus, X
} from 'lucide-vue-next'

const showDialog = ref(false)
</script>

<style scoped>
.threed-container {
  font-family: 'Inter', sans-serif;
  perspective: 1000px;
}

.threed-app-bar {
  @apply sticky top-0 z-10 bg-white/80 backdrop-blur-sm;
  border-bottom: 1px solid rgba(59, 130, 246, 0.1);
  transform-style: preserve-3d;
  transform: translateZ(10px);
}

.threed-icon-button {
  @apply p-2 rounded-full text-blue-600;
  transform-style: preserve-3d;
  transition: all 0.3s ease;
}

.threed-icon-button:hover {
  @apply bg-blue-100;
  transform: translateZ(5px);
}

.threed-card {
  @apply rounded-lg p-4 bg-white/80 backdrop-blur-sm;
  border: 1px solid rgba(59, 130, 246, 0.1);
  transform-style: preserve-3d;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.1), 0 2px 4px -1px rgba(59, 130, 246, 0.06);
}

.threed-card:hover {
  transform: translateZ(10px);
  box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.1), 0 4px 6px -2px rgba(59, 130, 246, 0.05);
}

.threed-nav-item {
  @apply flex items-center space-x-3 p-2 rounded-lg text-blue-600;
  transform-style: preserve-3d;
  transition: all 0.3s ease;
}

.threed-nav-item:hover {
  @apply bg-blue-100;
  transform: translateZ(5px);
}

.threed-nav-item.active {
  @apply text-blue-900 bg-blue-100;
  transform: translateZ(5px);
}

.threed-badge {
  @apply bg-blue-500 text-white text-xs px-2 py-1 rounded-full;
  transform: translateZ(5px);
}

.threed-list-item {
  @apply flex items-center space-x-4 p-2 rounded-lg;
  transform-style: preserve-3d;
  transition: all 0.3s ease;
}

.threed-list-item:hover {
  @apply bg-blue-100;
  transform: translateZ(5px);
}

.threed-avatar {
  @apply w-10 h-10 rounded-full flex items-center justify-center text-white font-medium;
  transform: translateZ(5px);
}

.threed-input-group {
  @apply space-y-1;
}

.threed-input {
  @apply w-full px-3 py-2 rounded-lg text-blue-900;
  border: 1px solid rgba(59, 130, 246, 0.1);
  transform-style: preserve-3d;
  transition: all 0.3s ease;
}

.threed-input:focus {
  @apply border-blue-400 outline-none;
  transform: translateZ(5px);
}

.threed-input::placeholder {
  @apply text-blue-400;
}

.threed-checkbox,
.threed-radio {
  @apply flex items-center space-x-2 cursor-pointer;
  transform-style: preserve-3d;
}

.threed-checkmark,
.threed-radiomark {
  @apply w-5 h-5 rounded;
  border: 1px solid rgba(59, 130, 246, 0.1);
  transform-style: preserve-3d;
  transition: all 0.3s ease;
}

.threed-checkmark {
  @apply rounded;
}

.threed-radiomark {
  @apply rounded-full;
}

.threed-checkbox input:checked + .threed-checkmark,
.threed-radio input:checked + .threed-radiomark {
  @apply bg-blue-500 border-blue-500;
  transform: translateZ(5px);
}

.threed-switch {
  @apply flex items-center space-x-2;
  transform-style: preserve-3d;
}

.threed-switch input {
  @apply hidden;
}

.threed-switch label {
  @apply relative inline-block w-12 h-6 rounded-full cursor-pointer;
  background: rgba(59, 130, 246, 0.1);
  transform-style: preserve-3d;
  transition: all 0.3s ease;
}

.threed-switch label:after {
  content: '';
  @apply absolute w-5 h-5 bg-white rounded-full top-0.5 left-0.5;
  transform: translateZ(5px);
  transition: all 0.3s ease;
}

.threed-switch input:checked + label {
  @apply bg-blue-500;
  transform: translateZ(5px);
}

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

.threed-button {
  @apply px-4 py-2 rounded-lg text-blue-900;
  border: 1px solid rgba(59, 130, 246, 0.1);
  transform-style: preserve-3d;
  transition: all 0.3s ease;
}

.threed-button:hover {
  @apply bg-blue-100;
  transform: translateZ(5px);
}

.threed-button.outlined {
  @apply bg-transparent border border-blue-300;
}

.threed-button.text {
  @apply bg-transparent border-none;
}

.threed-button.icon {
  @apply p-2 rounded-full;
}

.threed-progress {
  @apply h-1 rounded-full overflow-hidden;
  background: rgba(59, 130, 246, 0.1);
  transform-style: preserve-3d;
}

.threed-progress-bar {
  @apply h-full bg-blue-500 rounded-full;
  transform: translateZ(5px);
}

.threed-progress.circular {
  @apply w-12 h-12 rounded-full;
  background: rgba(59, 130, 246, 0.1);
  transform-style: preserve-3d;
}

.threed-progress-circle {
  @apply w-full h-full rounded-full border-4 border-blue-500;
  clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
  transform: translateZ(5px);
}

.threed-bottom-nav {
  @apply fixed bottom-0 left-0 right-0 bg-white/80 backdrop-blur-sm flex justify-around items-center py-2;
  border-top: 1px solid rgba(59, 130, 246, 0.1);
  transform-style: preserve-3d;
  transform: translateZ(10px);
}

.threed-bottom-nav-item {
  @apply flex flex-col items-center space-y-1 text-blue-600;
  transform-style: preserve-3d;
  transition: all 0.3s ease;
}

.threed-bottom-nav-item:hover {
  transform: translateZ(5px);
}

.threed-bottom-nav-item.active {
  @apply text-blue-900;
  transform: translateZ(5px);
}

.threed-dialog-overlay {
  @apply fixed inset-0 bg-black/20 flex items-center justify-center;
  transform-style: preserve-3d;
}

.threed-dialog {
  @apply rounded-lg p-4 bg-white/80 backdrop-blur-sm w-full max-w-md;
  border: 1px solid rgba(59, 130, 246, 0.1);
  transform-style: preserve-3d;
  transform: translateZ(20px);
  box-shadow: 0 20px 25px -5px rgba(59, 130, 246, 0.1), 0 10px 10px -5px rgba(59, 130, 246, 0.04);
}

.threed-dialog-header {
  @apply flex justify-between items-center p-4 border-b border-blue-200;
}

.threed-dialog-content {
  @apply p-4;
}

.threed-dialog-actions {
  @apply flex justify-end space-x-2 p-4 border-t border-blue-200;
}
</style> 