<template>
  <div class="skeuomorphic-container min-h-screen bg-gradient-to-b from-gray-100 to-gray-200">
    <!-- 顶部应用栏 -->
    <div class="skeuomorphic-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-gray-700 mr-4" />
          <h1 class="text-xl font-medium text-gray-700">Skeuomorphic Design</h1>
        </div>
        <div class="flex items-center space-x-4">
          <button class="skeuomorphic-icon-button">
            <Search class="w-5 h-5" />
          </button>
          <button class="skeuomorphic-icon-button">
            <Bell class="w-5 h-5" />
          </button>
          <button class="skeuomorphic-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="skeuomorphic-card">
          <div class="p-4">
            <h2 class="text-lg font-medium mb-4 text-gray-700">导航菜单</h2>
            <nav class="space-y-2">
              <a href="#" class="skeuomorphic-nav-item active">
                <Home class="w-5 h-5" />
                <span>首页</span>
              </a>
              <a href="#" class="skeuomorphic-nav-item">
                <Inbox class="w-5 h-5" />
                <span>收件箱</span>
                <span class="skeuomorphic-badge">12</span>
              </a>
              <a href="#" class="skeuomorphic-nav-item">
                <Star class="w-5 h-5" />
                <span>收藏</span>
              </a>
              <a href="#" class="skeuomorphic-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="skeuomorphic-card">
            <div class="p-4">
              <h2 class="text-lg font-medium mb-4 text-gray-700">卡片列表</h2>
              <div class="space-y-4">
                <div class="skeuomorphic-list-item">
                  <div class="skeuomorphic-avatar bg-blue-500">JD</div>
                  <div class="flex-1">
                    <h3 class="font-medium text-gray-700">卡片标题</h3>
                    <p class="text-gray-600">卡片副标题</p>
                  </div>
                  <button class="skeuomorphic-icon-button">
                    <MoreVertical class="w-5 h-5" />
                  </button>
                </div>
                <div class="skeuomorphic-list-item">
                  <div class="skeuomorphic-avatar bg-indigo-500">AB</div>
                  <div class="flex-1">
                    <h3 class="font-medium text-gray-700">另一个标题</h3>
                    <p class="text-gray-600">另一个副标题</p>
                  </div>
                  <button class="skeuomorphic-icon-button">
                    <MoreVertical class="w-5 h-5" />
                  </button>
                </div>
              </div>
            </div>
          </div>

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

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

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

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

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

    <!-- 对话框 -->
    <div v-if="showDialog" class="skeuomorphic-dialog-overlay">
      <div class="skeuomorphic-dialog">
        <div class="skeuomorphic-dialog-header">
          <h3 class="text-gray-700">对话框标题</h3>
          <button class="skeuomorphic-icon-button" @click="showDialog = false">
            <X class="w-5 h-5" />
          </button>
        </div>
        <div class="skeuomorphic-dialog-content">
          <p class="text-gray-600">这是一个拟物化设计风格的对话框示例。</p>
        </div>
        <div class="skeuomorphic-dialog-actions">
          <button class="skeuomorphic-button text" @click="showDialog = false">取消</button>
          <button class="skeuomorphic-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>
.skeuomorphic-container {
  font-family: 'Helvetica Neue', sans-serif;
  position: relative;
  overflow: hidden;
}

.skeuomorphic-app-bar {
  @apply sticky top-0 z-10;
  background: linear-gradient(to bottom, #f8f9fa, #e9ecef);
  border-bottom: 1px solid #dee2e6;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.skeuomorphic-icon-button {
  @apply p-2 rounded-md text-gray-700;
  background: linear-gradient(to bottom, #ffffff, #f8f9fa);
  border: 1px solid #dee2e6;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.skeuomorphic-icon-button:hover {
  background: linear-gradient(to bottom, #f8f9fa, #e9ecef);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.skeuomorphic-card {
  @apply rounded-lg p-4;
  background: linear-gradient(to bottom, #ffffff, #f8f9fa);
  border: 1px solid #dee2e6;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.skeuomorphic-nav-item {
  @apply flex items-center space-x-3 p-2 rounded-md text-gray-700;
  background: linear-gradient(to bottom, #ffffff, #f8f9fa);
  border: 1px solid #dee2e6;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.skeuomorphic-nav-item:hover {
  background: linear-gradient(to bottom, #f8f9fa, #e9ecef);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.skeuomorphic-nav-item.active {
  background: linear-gradient(to bottom, #3b82f6, #2563eb);
  border-color: #1d4ed8;
  color: white;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.skeuomorphic-badge {
  @apply bg-red-500 text-white text-xs px-2 py-1 rounded-md;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.skeuomorphic-list-item {
  @apply flex items-center space-x-4 p-2 rounded-md;
  background: linear-gradient(to bottom, #ffffff, #f8f9fa);
  border: 1px solid #dee2e6;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.skeuomorphic-list-item:hover {
  background: linear-gradient(to bottom, #f8f9fa, #e9ecef);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.skeuomorphic-avatar {
  @apply w-10 h-10 rounded-md flex items-center justify-center text-white font-medium;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

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

.skeuomorphic-input {
  @apply w-full px-3 py-2 rounded-md text-gray-700;
  background: linear-gradient(to bottom, #ffffff, #f8f9fa);
  border: 1px solid #dee2e6;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.skeuomorphic-input:focus {
  @apply outline-none;
  background: linear-gradient(to bottom, #ffffff, #f8f9fa);
  border-color: #3b82f6;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.skeuomorphic-checkbox,
.skeuomorphic-radio {
  @apply flex items-center space-x-2 cursor-pointer;
}

.skeuomorphic-checkmark,
.skeuomorphic-radiomark {
  @apply w-5 h-5;
  background: linear-gradient(to bottom, #ffffff, #f8f9fa);
  border: 1px solid #dee2e6;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.skeuomorphic-checkmark {
  @apply rounded-md;
}

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

.skeuomorphic-checkbox input:checked + .skeuomorphic-checkmark,
.skeuomorphic-radio input:checked + .skeuomorphic-radiomark {
  background: linear-gradient(to bottom, #3b82f6, #2563eb);
  border-color: #1d4ed8;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.skeuomorphic-switch {
  @apply flex items-center space-x-2;
}

.skeuomorphic-switch input {
  @apply hidden;
}

.skeuomorphic-switch label {
  @apply relative inline-block w-12 h-6 rounded-full cursor-pointer;
  background: linear-gradient(to bottom, #e5e7eb, #d1d5db);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.skeuomorphic-switch label:after {
  content: '';
  @apply absolute w-5 h-5 rounded-full top-0.5 left-0.5;
  background: linear-gradient(to bottom, #ffffff, #f8f9fa);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.skeuomorphic-switch input:checked + label {
  background: linear-gradient(to bottom, #3b82f6, #2563eb);
}

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

.skeuomorphic-button {
  @apply px-4 py-2 rounded-md text-white;
  background: linear-gradient(to bottom, #3b82f6, #2563eb);
  border: 1px solid #1d4ed8;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.skeuomorphic-button:hover {
  background: linear-gradient(to bottom, #2563eb, #1d4ed8);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.skeuomorphic-button.outlined {
  @apply bg-transparent border border-blue-500 text-blue-500;
  background: linear-gradient(to bottom, #ffffff, #f8f9fa);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.skeuomorphic-button.text {
  @apply bg-transparent border-none text-blue-500;
  box-shadow: none;
}

.skeuomorphic-button.icon {
  @apply p-2;
}

.skeuomorphic-progress {
  @apply h-2 rounded-full overflow-hidden;
  background: linear-gradient(to bottom, #e5e7eb, #d1d5db);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.skeuomorphic-progress-bar {
  @apply h-full rounded-full;
  background: linear-gradient(to bottom, #3b82f6, #2563eb);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.skeuomorphic-progress.circular {
  @apply w-12 h-12 rounded-full;
  background: linear-gradient(to bottom, #e5e7eb, #d1d5db);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.skeuomorphic-progress-circle {
  @apply w-full h-full border-4;
  border-color: #3b82f6;
  clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
}

.skeuomorphic-bottom-nav {
  @apply fixed bottom-0 left-0 right-0 flex justify-around items-center py-2;
  background: linear-gradient(to bottom, #f8f9fa, #e9ecef);
  border-top: 1px solid #dee2e6;
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.1);
}

.skeuomorphic-bottom-nav-item {
  @apply flex flex-col items-center space-y-1 text-gray-700;
  transition: all 0.2s ease;
}

.skeuomorphic-bottom-nav-item:hover {
  @apply text-blue-500;
}

.skeuomorphic-bottom-nav-item.active {
  @apply text-blue-500;
}

.skeuomorphic-dialog-overlay {
  @apply fixed inset-0 bg-black/50 flex items-center justify-center;
}

.skeuomorphic-dialog {
  @apply rounded-lg p-4 bg-white w-full max-w-md;
  background: linear-gradient(to bottom, #ffffff, #f8f9fa);
  border: 1px solid #dee2e6;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

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

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