<script>
export default {
  name: "ancientItem",
  props: {
    title: {
      type: String,
      default: "万佛塔"
    },
    description: {
      type: String,
      default: "万佛塔始建于2016年"
    },
    imageUrl: {
      type: String,
      default: ""
    },
    buttonText: {
      type: String,
      default: "了解详情"
    }
  },
  methods: {
    handleClick() {
      this.$emit('click')
    }
  }
}
</script>

<template>
  <view class="ancient-card" @click="handleClick">
    <view class="card-background">
      <image 
        v-if="imageUrl" 
        :src="imageUrl" 
        :alt="title"
        class="background-image"
        mode="aspectFill"
      />
      <view v-else class="placeholder-background"></view>
    </view>
    
    <view class="card-content">
      <text class="card-title">{{ title }}</text>
      <text class="card-description">{{ description }}</text>
      <view class="card-button">
        <text>{{ buttonText }}</text>
        <view class="arrow-icon">
          <text class="arrow-text">→</text>
        </view>
      </view>
    </view>
  </view>
</template>

<style scoped lang="scss">
.ancient-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  height: 280px;
  border-radius: 16px;
  overflow: hidden;
}

.card-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  
  .background-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(8px);
  }
  
  .placeholder-background {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    filter: blur(8px);
  }
}

.card-content {
  position: relative;
  z-index: 2;
  height: 100%;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 100%
  );
  backdrop-filter: blur(10px);
}

.card-title {
  color: white;
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 12px 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  line-height: 1.2;
}

.card-description {
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  margin: 0 0 24px 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  line-height: 1.4;
}

.card-button {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 25px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  backdrop-filter: blur(10px);
}

.arrow-icon {
  margin-left: 8px;
}

.arrow-text {
  font-size: 16px;
  color: white;
}

// 响应式设计
@media (max-width: 768px) {
  .ancient-card {
    max-width: 100%;
    height: 240px;
  }
  
  .card-content {
    padding: 24px 20px;
  }
  
  .card-title {
    font-size: 24px;
  }
  
  .card-description {
    font-size: 14px;
  }
}
</style>