<template>
  <div class="lesson-preparation-content">
    <div v-if="lesson.preparation" class="preparation-wrapper">
      <a-alert
        message="教学准备"
        description="课前需要准备的材料、环境和资源"
        type="info"
        show-icon
        closable
        class="preparation-alert"
      />

      <div class="preparation-content rich-content" v-html="lesson.preparation"></div>
    </div>

    <a-empty v-else description="暂无教学准备内容" />
  </div>
</template>

<script setup lang="ts">
defineProps<{
  lesson: any;
}>();
</script>

<style scoped>
.lesson-preparation-content {
  min-height: 400px;
}

.preparation-alert {
  margin-bottom: 20px;
}

.preparation-wrapper {
  background: white;
}

.preparation-content {
  padding: 24px;
  background: linear-gradient(135deg, #F0F7FF 0%, #F9F9F9 100%);
  border-radius: 12px;
  border-left: 4px solid #1890ff;
  line-height: 2;
  color: #666;
  font-size: 14px;
}

.rich-content :deep(p) {
  margin-bottom: 16px;
}

.rich-content :deep(p:last-child) {
  margin-bottom: 0;
}

.rich-content :deep(ul),
.rich-content :deep(ol) {
  padding-left: 28px;
  margin-bottom: 16px;
}

.rich-content :deep(li) {
  margin-bottom: 8px;
}

.rich-content :deep(strong) {
  color: #333;
  font-weight: 600;
}

.rich-content :deep(h3) {
  margin-top: 20px;
  margin-bottom: 12px;
  font-weight: 600;
  color: #1890ff;
}
</style>
