<template>
  <div class="fwsc-page">
    <div class="main-content">
      <!-- 当前位置导航 -->
      <div class="breadcrumb-box">
        <span class="breadcrumb-text">当前位置：</span>
        <span class="breadcrumb-link" @click="goHome">首页</span>
        <span class="breadcrumb-separator">/</span>
        <span class="breadcrumb-current">服务中心</span>
      </div>

      <!-- Banner 区 -->
      <div class="banner-section">
        <div class="banner-content">
          <h1 class="banner-title">可信碳服务中心</h1>
          <p class="banner-subtitle">链接全球碳资产，赋能绿色价值链。一站式解决碳服务撮合、绿色交易与金融对接需求。</p>
        </div>
      </div>

      <!-- 四大服务入口卡片 -->
      <div class="services-section">
        <div class="services-grid">
          <!-- 碳服务市场 -->
          <div class="service-card" @click="goToPage('/tfwsc')">
            <div class="service-card-icon">
              <span style="font-size: 48px">🌐</span>
            </div>
            <h3 class="service-card-title">碳服务市场</h3>
            <p class="service-card-desc">汇聚全国优质第三方服务机构，提供从核算到认证的全链条专业服务。</p>
            <div class="service-card-buttons">
              <t-button theme="primary" variant="outline" @click.stop="goToPage('/tfwsc')">浏览服务信息</t-button>
              <t-button theme="primary" @click.stop="goToPage('/tfwsc?publish=1')">我要发布服务</t-button>
            </div>
          </div>

          <!-- 碳需求市场 -->
          <div class="service-card" @click="goToPage('/txqsc')">
            <div class="service-card-icon">
              <span style="font-size: 48px">📋</span>
            </div>
            <h3 class="service-card-title">碳需求市场</h3>
            <p class="service-card-desc">企业发布真实服务采购需求，智能匹配靠谱服务商，杜绝中间商差价。</p>
            <div class="service-card-buttons">
              <t-button theme="primary" variant="outline" @click.stop="goToPage('/txqsc')">浏览求购信息</t-button>
              <t-button theme="primary" @click.stop="goToPage('/txqsc?publish=1')">我要发布需求</t-button>
            </div>
          </div>

          <!-- 碳金融市场 -->
          <div class="service-card" @click="goToPage('/tjrsc')">
            <div class="service-card-icon">
              <span style="font-size: 48px">💰</span>
            </div>
            <h3 class="service-card-title">碳金融市场</h3>
            <p class="service-card-desc">打通"碳"与"钱"的通道。提供碳质押、碳回购、绿色信贷及碳基金对接服务。</p>
            <div class="service-card-buttons">
              <t-button theme="primary" variant="outline" @click.stop="goToPage('/tjrsc')">查看金融产品</t-button>
              <t-button theme="primary" @click.stop="goToPage('/tjrsc')">金融机构入驻</t-button>
            </div>
          </div>

          <!-- 碳数据市场 -->
          <div class="service-card" @click="goToPage('/tsjsc')">
            <div class="service-card-icon">
              <span style="font-size: 48px">📊</span>
            </div>
            <h3 class="service-card-title">碳数据市场</h3>
            <p class="service-card-desc">合规高效的碳数据流转平台。包括公共数据、社会性数据、因子库等多类数据库。</p>
            <div class="service-card-buttons">
              <t-button theme="primary" variant="outline" @click.stop="goToPage('/tsjsc')">进入交易大厅</t-button>
              <t-button theme="primary" @click.stop="goToPage('/tsjsc')">我要出售</t-button>
            </div>
          </div>
        </div>
      </div>
    </div>

    <Footer />
  </div>
</template>

<script>
import NewNav from '@/pages/index/components/new-nav/index.vue';
import Footer from '@/pages/index/components/footer/index.vue';

export default {
  name: 'FwscIndex',
  components: {
    NewNav,
    Footer
  },
  methods: {
    goHome() {
      this.$router.push('/view/mhzc/home');
    },
    goToPage(path) {
      this.$router.push(path);
    }
  }
};
</script>

<style lang="less" scoped>
.fwsc-page {
  min-height: 100vh;
  background: #f5f5f5;
}

.main-content {
}

// 当前位置导航
.breadcrumb-box {
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 200px;
  background: #fff;
  border-bottom: 1px solid #eee;
}

.breadcrumb-text {
  font-size: 14px;
  color: #666;
}

.breadcrumb-link {
  font-size: 14px;
  color: #009a29;
  cursor: pointer;
  transition: color 0.3s;
}

.breadcrumb-link:hover {
  color: #007a1f;
}

.breadcrumb-separator {
  margin: 0 8px;
  font-size: 14px;
  color: #999;
}

.breadcrumb-current {
  font-size: 14px;
  color: #333;
}

// Banner 区
.banner-section {
  display: flex;
  height: 280px;
  text-align: center;
  background: linear-gradient(135deg, #009a29 0%, #4caf50 100%);
  align-items: center;
  justify-content: center;
}

.banner-content {
  max-width: 800px;
  padding: 0 20px;
}

.banner-title {
  margin-bottom: 16px;
  font-size: 48px;
  font-weight: 600;
  line-height: 64px;
  letter-spacing: 0;
  color: #fff;
}

.banner-subtitle {
  font-size: 18px;
  font-weight: 400;
  line-height: 28px;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.9);
}

// 四大服务入口
.services-section {
  padding: 60px 200px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.service-card {
  display: flex;
  padding: 32px;
  cursor: pointer;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  flex-direction: column;

  &:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 154, 41, 0.15);
  }
}

.service-card-icon {
  display: flex;
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
  align-items: center;
  justify-content: center;

  img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
}

.service-card-title {
  margin-bottom: 12px;
  font-size: 24px;
  font-weight: 600;
  line-height: 32px;
  letter-spacing: 0;
  color: #1a1a1a;
}

.service-card-desc {
  margin-bottom: 24px;
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
  letter-spacing: 0;
  color: #666;
  flex-grow: 1;
}

.service-card-buttons {
  display: flex;
  gap: 12px;

  .t-button {
    flex: 1;
  }
}

@media (max-width: 1200px) {
  .services-section {
    padding: 40px 100px;
  }
}

@media (max-width: 900px) {
  .services-section {
    padding: 30px 40px;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .service-card {
    padding: 24px;
  }
}

@media (max-width: 768px) {
  .breadcrumb-box {
    height: 40px;
    padding: 0 16px;
  }

  .banner-section {
    height: 200px;
  }

  .banner-title {
    font-size: 32px;
    line-height: 44px;
  }

  .banner-subtitle {
    font-size: 14px;
    line-height: 22px;
  }

  .services-section {
    padding: 20px 16px;
  }

  .services-grid {
    gap: 16px;
  }

  .service-card {
    padding: 20px;
  }

  .service-card-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;

    span {
      font-size: 36px;
    }
  }

  .service-card-title {
    margin-bottom: 8px;
    font-size: 20px;
  }

  .service-card-desc {
    margin-bottom: 16px;
    font-size: 13px;
  }

  .service-card-buttons {
    flex-direction: column;
    gap: 8px;

    .t-button {
      width: 100%;
    }
  }
}

@media (max-width: 480px) {
  .breadcrumb-box {
    font-size: 12px;
  }

  .banner-section {
    height: 160px;
  }

  .banner-title {
    font-size: 24px;
    line-height: 36px;
  }

  .banner-subtitle {
    font-size: 12px;
  }

  .services-section {
    padding: 16px 12px;
  }

  .service-card {
    padding: 16px;
  }

  .service-card-icon {
    width: 40px;
    height: 40px;

    span {
      font-size: 28px;
    }
  }

  .service-card-title {
    font-size: 18px;
  }
}
</style>
