<template>
  <div class="scoreboard-module">
    <slot name="header">
      <header class="module-header">
        <h1>{{ title }}</h1>
        <p>{{ description }}</p>
      </header>
    </slot>

    <div class="module-content">
      <slot />
    </div>

    <footer class="module-footer">
      <slot name="footer">
        <p>© {{ currentYear }} 运动会记分板系统 - 版权所有</p>
      </slot>
    </footer>
  </div>
</template>

<script setup lang="ts">
interface Props {
  title?: string
  description?: string
}

const props = withDefaults(defineProps<Props>(), {
  title: '运动会记分板',
  description: '运动会管理系统'
})

const currentYear = new Date().getFullYear()
</script>

<style scoped>
.scoreboard-module {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.module-header {
  background-color: #304156;
  color: #fff;
  padding: 20px;
  text-align: center;
}

.module-header h1 {
  margin: 0 0 8px 0;
  font-size: 24px;
}

.module-header p {
  margin: 0;
  opacity: 0.8;
  font-size: 14px;
}

.module-content {
  flex: 1;
  background-color: #f0f2f5;
}

.module-footer {
  background-color: #fff;
  border-top: 1px solid #e6e6e6;
  padding: 12px;
  text-align: center;
}

.module-footer p {
  margin: 0;
  color: #909399;
  font-size: 12px;
}
</style>
