<script setup lang="ts">
import type { ActivityNode } from '../types'

defineProps<{ node: ActivityNode }>()
defineEmits(['back', 'draw'])
</script>

<template>
  <div class="h-full w-full flex flex-col items-center pt-44">
    <!-- 标题卷轴 -->
    <div class="relative mb-16">
      <div class="relative z-10 h-20 min-w-[300px] flex items-center justify-center border-2 border-orange-200 rounded-lg from-orange-100 to-orange-50 bg-gradient-to-b px-12 shadow-lg">
        <div class="absolute top-1/2 h-24 w-6 border-r-4 border-yellow-600 rounded-l-md bg-teal-700 shadow-md -left-3 -translate-y-1/2">
          <div class="absolute left-1 top-2 h-2 w-full rounded-full bg-teal-600/50" />
          <div class="absolute bottom-2 left-1 h-2 w-full rounded-full bg-teal-600/50" />
        </div>
        <div class="absolute top-1/2 h-24 w-6 border-l-4 border-yellow-600 rounded-r-md bg-teal-700 shadow-md -right-3 -translate-y-1/2">
          <div class="absolute right-1 top-2 h-2 w-full rounded-full bg-teal-600/50" />
          <div class="absolute bottom-2 right-1 h-2 w-full rounded-full bg-teal-600/50" />
        </div>
        <h1 class="text-3xl text-gray-800 font-bold tracking-widest font-serif">
          {{ node.moduleName }}
        </h1>
      </div>
    </div>

    <!-- 规则描述 -->
    <div class="mb-20 max-w-4xl text-center">
      <div class="text-2xl text-gray-800 font-medium leading-relaxed tracking-wide">
        {{ node.description }}
      </div>
    </div>

    <!-- 抽题按钮 (大圆形) -->
    <div class="group relative">
      <button
        class="h-64 w-64 flex flex-col items-center justify-center border-4 border-blue-400 rounded-full bg-gray-200/80 text-3xl text-gray-700 font-bold shadow-xl transition-all active:scale-95 hover:scale-105"
        @click="$emit('draw')"
      >
        <span>抽题</span>
      </button>
    </div>

    <!-- 底部按钮 -->
    <div class="fixed bottom-12 left-12">
      <button
        class="border-2 border-red-400 rounded-full bg-white px-10 py-2 text-xl text-red-500 font-bold shadow-md transition hover:bg-red-50"
        @click="$emit('back')"
      >
        返回
      </button>
    </div>

    <div class="fixed bottom-12 right-12">
      <button
        class="rounded-full from-red-400 to-red-500 bg-gradient-to-r px-10 py-2 text-xl text-white font-bold shadow-lg transition hover:from-red-500 hover:to-red-600"
        @click="$emit('draw')"
      >
        开始答题
      </button>
    </div>
  </div>
</template>
