<template>
  <div class="course-environment-content">
    <div v-if="course.environmentConstruction" class="environment-wrapper">
      <a-alert
        message="环创建设建议"
        description="以下内容提供了主题环境布置、区域活动环境、阅读角创设等方面的建议"
        type="info"
        show-icon
        closable
        class="environment-alert"
      />

      <div class="environment-content rich-content" v-html="course.environmentConstruction"></div>
    </div>

    <a-empty v-else description="暂无环创建设内容" />
  </div>
</template>

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

<style scoped>
.course-environment-content {
  min-height: 400px;
}

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

.environment-wrapper {
  background: white;
}

.environment-content {
  padding: 24px;
  background: linear-gradient(135deg, #F9F9F9 0%, #F5F5F5 100%);
  border-radius: 12px;
  border-left: 4px solid #52c41a;
  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(h1),
.rich-content :deep(h2),
.rich-content :deep(h3) {
  margin-top: 20px;
  margin-bottom: 12px;
  font-weight: 600;
  color: #333;
}

.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;
}
</style>
