<template>
  <view class="dashboard-header">
    <view class="header-bg"></view>
    <view class="header-content">
      <text class="header-title">数据看板</text>
      <view class="header-tabs">
        <view
          :class="['tab', activeTab === 'crystal' ? 'tab-active' : '']"
          @tap="$emit('update:activeTab', 'crystal')"
        >
          水晶相关
        </view>
        <view
          :class="['tab', activeTab === 'season' ? 'tab-active' : '']"
          @tap="$emit('update:activeTab', 'season')"
        >
          赛季总览
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  name: 'DashboardHeader',
  props: {
    activeTab: { type: String, default: 'crystal' },
  },
  emits: ['update:activeTab'],
}
</script>

<style lang="scss" scoped>
.dashboard-header {
  position: relative;
  height: 280rpx;
  overflow: hidden;
}

.header-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 700rpx;
  background: linear-gradient(179deg, #FFE5E5 0%, #F3A0A1 50%, #FF9C9C 86%, #FF2024 100%);
  filter: blur(4px);
  z-index: 0;
}

.header-content {
  position: relative;
  z-index: 1;
  padding: 80rpx 32rpx 32rpx;
}

.header-title {
  display: block;
  font-size: 48rpx;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
  text-align: center;
  margin-bottom: 32rpx;
}

.header-tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 22rpx;
  padding: 6rpx;
  margin: 0 100rpx;
}

.tab {
  flex: 1;
  text-align: center;
  padding: 16rpx 0;
  font-size: 28rpx;
  color: rgba(255, 255, 255, 0.7);
  border-radius: 22rpx;
  transition: all 0.25s ease;
}

.tab-active {
  background: linear-gradient(231deg, #A8A6ED 0%, #88C8D8 64%, #F380EF 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
}
</style>
