<template>
  <div class="ant-container min-h-screen bg-gray-50">
    <!-- 顶部导航栏 -->
    <div class="ant-header">
      <div class="ant-header-content">
        <div class="ant-logo">
          <img :src="logoUrl" alt="Ant Design Logo" class="ant-logo-img">
          <span class="ant-logo-text">Ant Design</span>
        </div>
        <div class="ant-nav">
          <a href="#" class="ant-nav-item active">首页</a>
          <a href="#" class="ant-nav-item">组件</a>
          <a href="#" class="ant-nav-item">文档</a>
          <a href="#" class="ant-nav-item">主题</a>
        </div>
        <div class="ant-header-actions">
          <button class="ant-btn text">
            <Search class="w-5 h-5" />
          </button>
          <button class="ant-btn text">
            <Bell class="w-5 h-5" />
          </button>
          <button class="ant-btn text">
            <User class="w-5 h-5" />
          </button>
        </div>
      </div>
    </div>

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

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

      <!-- 按钮组 -->
      <div class="ant-btn-group">
        <button class="ant-btn primary">主要按钮</button>
        <button class="ant-btn default">默认按钮</button>
        <button class="ant-btn dashed">虚线按钮</button>
        <button class="ant-btn text">文本按钮</button>
        <button class="ant-btn link">链接按钮</button>
      </div>

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

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

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

      <!-- 通知面板 -->
      <div v-if="showNotifications" class="ant-notification">
        <div class="ant-notification-notice">
          <div class="ant-notification-notice-content">
            <div class="ant-notification-notice-icon">
              <Bell class="w-5 h-5" />
            </div>
            <div class="ant-notification-notice-message">通知标题</div>
            <div class="ant-notification-notice-description">通知内容</div>
          </div>
          <button class="ant-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,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSIxNiIgY3k9IjE2IiByPSIxNiIgZmlsbD0idXJsKCNwYWludDApIi8+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJwYWludDAiIHgxPSIwIiB5MT0iMCIgeDI9IjMyIiB5Mj0iMzIiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj48c3RvcCBzdG9wLWNvbG9yPSIjMTg5MEZGIi8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjMDA2NkZGIi8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PC9zdmc+'

const cards = ref([
  {
    id: 1,
    title: '卡片标题',
    description: '副标题',
    content: '这是卡片的内容，可以包含多行文本。',
    cover: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIwIiBoZWlnaHQ9IjI0MCIgdmlld0JveD0iMCAwIDMyMCAyNDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHJlY3Qgd2lkdGg9IjMyMCIgaGVpZ2h0PSIyNDAiIGZpbGw9IiNGRkZGRkYiLz48cGF0aCBkPSJNMTYwIDYwQzEzMy40MzEgNjAgMTEyIDgxLjQzMSAxMTIgMTA4QzExMiAxMzQuNTY5IDEzMy40MzEgMTU2IDE2MCAxNTZDMTg2LjU2OSAxNTYgMjA4IDEzNC41NjkgMjA4IDEwOEMyMDggODEuNDMxIDE4Ni41NjkgNjAgMTYwIDYwWiIgZmlsbD0iIzE4OTBGRiIvPjxwYXRoIGQ9Ik0xNjAgMTgwQzEzMy40MzEgMTgwIDExMiAyMDEuNDMxIDExMiAyMjhDMTEyIDI1NC41NjkgMTMzLjQzMSAyNzYgMTYwIDI3NkMxODYuNTY5IDI3NiAyMDggMjU0LjU2OSAyMDggMjI4QzIwOCAyMDEuNDMxIDE4Ni41NjkgMTgwIDE2MCAxODBaIiBmaWxsPSIjMDA2NkZGIi8+PC9zdmc+',
    likes: 42,
    comments: 8,
    initials: 'JD',
    avatarClass: 'bg-blue-500'
  },
  {
    id: 2,
    title: '另一个标题',
    description: '另一个副标题',
    content: '这是另一个卡片的内容。',
    cover: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIwIiBoZWlnaHQ9IjI0MCIgdmlld0JveD0iMCAwIDMyMCAyNDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHJlY3Qgd2lkdGg9IjMyMCIgaGVpZ2h0PSIyNDAiIGZpbGw9IiNGRkZGRkYiLz48cGF0aCBkPSJNMTYwIDYwQzEzMy40MzEgNjAgMTEyIDgxLjQzMSAxMTIgMTA4QzExMiAxMzQuNTY5IDEzMy40MzEgMTU2IDE2MCAxNTZDMTg2LjU2OSAxNTYgMjA4IDEzNC41NjkgMjA4IDEwOEMyMDggODEuNDMxIDE4Ni41NjkgNjAgMTYwIDYwWiIgZmlsbD0iIzAwNjZGRiIvPjxwYXRoIGQ9Ik0xNjAgMTgwQzEzMy40MzEgMTgwIDExMiAyMDEuNDMxIDExMiAyMjhDMTEyIDI1NC41NjkgMTMzLjQzMSAyNzYgMTYwIDI3NkMxODYuNTY5IDI3NiAyMDggMjU0LjU2OSAyMDggMjI4QzIwOCAyMDEuNDMxIDE4Ni41NjkgMTgwIDE2MCAxODBaIiBmaWxsPSIjMTg5MEZGIi8+PC9zdmc+',
    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>
.ant-container {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
}

.ant-header {
  @apply fixed top-0 left-0 right-0 h-16 bg-white shadow-sm z-10;
}

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

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

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

.ant-logo-text {
  @apply ml-2 text-xl font-medium text-gray-900;
}

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

.ant-nav-item {
  @apply text-gray-600 hover:text-blue-500;
}

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

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

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

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

.ant-card {
  @apply bg-white rounded overflow-hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

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

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

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

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

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

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

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

.ant-card-meta-title {
  @apply text-base font-medium text-gray-900;
}

.ant-card-meta-description {
  @apply text-sm text-gray-500;
}

.ant-card-content {
  @apply text-gray-600 mb-4;
}

.ant-card-actions {
  @apply flex items-center border-t border-gray-100 pt-4;
}

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

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

.ant-form-item-label {
  @apply mb-2 text-gray-600;
}

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

.ant-input,
.ant-select {
  @apply w-full px-4 py-2 border border-gray-300 rounded hover:border-blue-500 focus:border-blue-500 focus:ring-1 focus:ring-blue-500;
}

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

.ant-switch input {
  @apply hidden;
}

.ant-switch-inner {
  @apply absolute inset-0 rounded-full bg-gray-300 transition-colors duration-300;
}

.ant-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;
}

.ant-switch input:checked + .ant-switch-inner {
  @apply bg-blue-500;
}

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

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

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

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

.ant-btn.default {
  @apply bg-white text-gray-600 border border-gray-300 hover:border-blue-500 hover:text-blue-500;
}

.ant-btn.dashed {
  @apply bg-white text-gray-600 border border-dashed border-gray-300 hover:border-blue-500 hover:text-blue-500;
}

.ant-btn.text {
  @apply bg-transparent text-gray-600 hover:text-blue-500;
}

.ant-btn.link {
  @apply bg-transparent text-blue-500 hover:text-blue-600;
}

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

.ant-tabs-nav {
  @apply flex border-b border-gray-200;
}

.ant-tabs-tab {
  @apply px-4 py-3 text-gray-600 cursor-pointer hover:text-blue-500;
}

.ant-tabs-tab.active {
  @apply text-blue-500 border-b-2 border-blue-500;
}

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

.ant-tabs-tabpane {
  @apply bg-white rounded p-4;
}

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

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

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

.ant-modal-content {
  @apply bg-white rounded shadow-lg;
}

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

.ant-modal-title {
  @apply text-lg font-medium text-gray-900;
}

.ant-modal-close {
  @apply text-gray-400 hover:text-gray-500;
}

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

.ant-modal-footer {
  @apply flex justify-end space-x-2 p-4 border-t border-gray-200;
}

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

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

.ant-message-notice-content {
  @apply flex items-center px-4 py-3 bg-white rounded shadow-lg;
}

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

.ant-notification-notice {
  @apply mb-4 bg-white rounded shadow-lg overflow-hidden;
}

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

.ant-notification-notice-icon {
  @apply float-left mr-4 text-blue-500;
}

.ant-notification-notice-message {
  @apply text-base font-medium text-gray-900;
}

.ant-notification-notice-description {
  @apply mt-1 text-sm text-gray-500;
}

.ant-notification-notice-close {
  @apply absolute top-4 right-4 text-gray-400 hover:text-gray-500;
}
</style> 