<template>
  <div class="platform-policy gradient-background-circles">
    <MobileHeader title="Platform Policy" />

    <div class="content">
      <div class="policy-list">
        <div 
          v-for="policy in policies" 
          :key="policy.level"
          class="policy-item"
        >
          <div class="policy-header">
            <h3>{{ policy.level }}</h3>
          </div>
          
          <div class="policy-details">
            <div class="policy-grid">
              <div class="policy-cell">
                <span class="cell-label">Time (hours)</span>
                <span class="cell-value">{{ policy.timeHours }}</span>
              </div>
              <div class="policy-cell">
                <span class="cell-label">Target</span>
                <span class="cell-value">{{ policy.target }}</span>
              </div>
              <div class="policy-cell">
                <span class="cell-label">Host Salary</span>
                <span class="cell-value">${{ policy.hostSalary }}</span>
              </div>
            </div>
            
            <div class="policy-grid bottom-row">
              <div class="policy-cell">
                <span class="cell-label">Agent Salary</span>
                <span class="cell-value">${{ policy.agentSalary }}</span>
              </div>
              <div class="policy-cell">
                <span class="cell-label">Total Salary</span>
                <span class="cell-value">${{ policy.totalSalary }}</span>
              </div>
              <div class="policy-cell empty"></div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import MobileHeader from '../components/MobileHeader.vue'

const router = useRouter()

// 政策数据
const policies = ref([
  {
    level: 'Lv.1',
    timeHours: 20,
    target: 32500,
    hostSalary: 3,
    agentSalary: 1,
    totalSalary: 4
  },
  {
    level: 'Lv.2',
    timeHours: 20,
    target: 65000,
    hostSalary: 6,
    agentSalary: 2,
    totalSalary: 8
  },
  {
    level: 'Lv.3',
    timeHours: 15,
    target: 108000,
    hostSalary: 10,
    agentSalary: 3,
    totalSalary: 13
  }
])
</script>

<style scoped>
.platform-policy {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.content {
  padding: 16px;
  position: relative;
  z-index: 2;
}

.policy-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.policy-item {
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
}

.policy-header {
  padding: 16px 16px 8px 16px;
  border-bottom: 1px solid #f0f0f0;
}

.policy-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.policy-details {
  padding: 16px;
}

.policy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.policy-grid.bottom-row {
  margin-bottom: 0;
}

.policy-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.policy-cell.empty {
  visibility: hidden;
}

.cell-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
  line-height: 1.3;
}

.cell-value {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

/* 响应式调整 */
@media (max-width: 480px) {
  .policy-grid {
    gap: 12px;
  }
  
  .cell-label {
    font-size: 11px;
  }
  
  .cell-value {
    font-size: 14px;
  }
}
</style>
