<template>
  <view class="section-wrapper">
    <view class="section-header">
      <view class="section-title">{{ title }}</view>
      <view class="section-header-right">
        <slot name="header-right"></slot>
      </view>
    </view>
    <view class="section-body">
      <slot></slot>
    </view>
  </view>
</template>

<script>
export default {
  name: 'SectionTitle',
  props: {
    title: {
      type: String,
      default: ''
    }
  }
}
</script>

<style lang="scss" scoped>
.section-wrapper {
    background: #fff;
    border-radius: 20rpx;
    padding: 32rpx;
    margin-bottom: 24rpx;
    border: 1rpx solid #e0e0e0;
    box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24rpx;
}

.section-title {
    font-size: 30rpx;
    font-weight: 600;
    color: #333;
    position: relative;
    padding-left: 16rpx;

    &::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 4rpx;
        height: 28rpx;
        background: #60A5FA;
        border-radius: 2rpx;
    }
}

.section-header-right {
    font-size: 24rpx;
    color: #666;
}
</style>