<template>
  <div class="financial-container">
    <!-- 导航栏 -->
    <div class="nav-bar">
      <div class="back-btn" @click="$router.back()">
        <i class="arrow-left"></i>
      </div>
      <div class="title">提升额度</div>
    </div>
    <!-- 页面内容 -->
    <div class="content">
      <div class="wrap">
        <div class="card-list">
          <div v-for="(card, index) in cards" :key="index" class="card-col">
            <div class="card-item">
              <div class="card-image">
                <img src="@/assets/card.jpg" alt="信用卡" draggable="false">
              </div>
              <div class="card-info">
                <div class="limit-text">额度 {{ card.limit }}</div>
                <button class="upgrade-button" @click="handleUpgrade(card)">立即提升</button>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Financial',
  data() {
    return {
      cards: [
        { limit: '100 万', amount: 310 },
        { limit: '300 万', amount: 620 },
        { limit: '500 万', amount: 930 },
        { limit: '1000 万', amount: 1240 },
        { limit: '2000 万', amount: 1550 },
        { limit: '2000万以上', amount: 1860 }
      ]
    }
  },
  methods: {
    handleUpgrade(card) {
      this.$router.push({
        path: '/charges',
        query: {
          type: '4',
          money: card.amount,
          title: '到账额度提升'
        }
      });
    }
  }
}
</script>

<style scoped>
.financial-container {
  min-height: 100vh;
  background: linear-gradient(to bottom, #2f9580 0%, #4fb3a1 100%);
  padding-bottom: 80px;
}

.nav-bar {
  height: 56px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: #fff;
  display: flex;
  align-items: center;
  position: relative;
  padding: 0 15px;
}

.back-btn {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.arrow-left {
  width: 12px;
  height: 12px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
}

.title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 18px;
  font-weight: 600;
}

.content {
  padding: 20px 16px;
  min-height: calc(100vh - 56px);
}

.wrap {
  padding: 0;
}

.card-list {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -6px;
}

.card-col {
  width: 50%;
  padding: 6px;
  box-sizing: border-box;
}

.card-item {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.card-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.card-image {
  width: 100%;
  height: 0;
  padding-bottom: 60%;
  position: relative;
  overflow: hidden;
}

.card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-info {
  padding: 16px;
  text-align: center;
}

.limit-text {
  font-size: 16px;
  color: #374151;
  margin-bottom: 16px;
  font-weight: 600;
}

.upgrade-button {
  background: #2f9580;
  color: #fff;
  border: none;
  border-radius: 8px;
  width: 100%;
  height: 40px;
  line-height: 40px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin: 0 auto;
  display: block;
  transition: all 0.3s ease;
}

.upgrade-button:hover {
  background: #268371;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(47, 149, 128, 0.3);
}

.upgrade-button:active {
  opacity: 0.9;
  transform: translateY(0);
}

/* 移动端适配 */
@media (max-width: 768px) {
  .nav-bar {
    height: 50px;
    padding: 0 12px;
  }
  
  .back-btn {
    width: 36px;
    height: 36px;
  }
  
  .title {
    font-size: 16px;
  }
  
  .content {
    padding: 16px 12px;
  }
  
  .card-list {
    margin: 0 -4px;
  }
  
  .card-col {
    padding: 4px;
  }
  
  .card-info {
    padding: 12px;
  }
  
  .limit-text {
    font-size: 15px;
    margin-bottom: 12px;
  }
  
  .upgrade-button {
    height: 36px;
    line-height: 36px;
    font-size: 13px;
  }
}
</style>
