<template>
  <footer class="bg-dark text-white">
    <div class="footer-container">
      <!-- 上部信息区 -->
      <div class="footer-top">
        <!-- 指导单位 -->
        <div class="footer-column">
          <div class="footer-title">指导单位</div>
          <div class="footer-links">
            <div class="footer-link-item">上海市数据局</div>
            <div class="footer-link-item">宝山区政府</div>
          </div>
        </div>

        <!-- 主办单位 -->
        <!-- <div class="footer-column">
          <div class="footer-title">主办单位</div>
          <div class="footer-links">
            <div class="footer-link-item">宝山区数据局</div>
            <div class="footer-link-item">宝山区发改委</div>
          </div>
        </div> -->

        <!-- 运营单位 -->
        <div class="footer-column">
          <div class="footer-title">运营单位</div>
          <div class="footer-links">
            <div class="footer-link-item">上海浦江数链数字科技有限公司</div>
          </div>
        </div>

        <!-- 业务支持 -->
        <div class="footer-column">
          <div class="footer-title">业务支持</div>
          <div class="footer-links">
            <div class="footer-link-item">上海数字基础设施协会可信碳专委会</div>
          </div>
        </div>

        <!-- 联系方式 -->
        <div class="footer-column contact-column">
          <div class="footer-title">联系我们</div>
          <div class="footer-links contact-info">
            <div class="contact-item">
              <span class="contact-icon">📧</span>
              <span>{{ contact.email }}</span>
            </div>
            <div class="contact-item">
              <span class="contact-icon">📍</span>
              <span>{{ contact.address }}</span>
            </div>
          </div>
        </div>
      </div>

      <!-- 分隔线 -->
      <div class="footer-divider"></div>

      <!-- 下部版权信息 -->
      <div class="footer-bottom">
        <!-- <p class="copyright">{{ copyright }}</p> -->
        <p class="copyright">© 2025 可信碳信息网 版权所有</p>
        <p class="infrastructure">技术支持：上海市宝山区大数据中心</p>
        <p class="infrastructure">基础设施：国家区块链网络基础底座</p>
      </div>
    </div>
  </footer>
</template>

<script>
import { mapState } from 'vuex';

export default {
  name: 'Footer',
  data() {
    return {};
  },
  computed: {
    ...mapState('settings', ['APP_NAME', 'contact', 'copyright']),
  },
};
</script>

<style lang="less" scoped>
.footer-container {
  max-width: 1400px;
  padding: 40px 20px 20px;
  margin: 0 auto;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 30px;
}

.footer-column {
  max-width: 280px;
  min-width: 150px;
  flex: 1;
}

.footer-title {
  position: relative;
  padding-left: 12px;
  margin-bottom: 16px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;

  &::before {
    position: absolute;
    top: 50%;
    left: 0;
    width: 4px;
    height: 16px;
    background: linear-gradient(180deg, #4caf50, #2e7d32);
    border-radius: 2px;
    content: '';
    transform: translateY(-50%);
  }
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-link-item {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.3s;

  &:hover {
    color: #4caf50;
  }
}

.contact-column {
  flex: 1.2;
}

.contact-info {
  gap: 12px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.contact-icon {
  flex-shrink: 0;
  font-size: 14px;
}

.footer-divider {
  height: 1px;
  margin: 30px 0 20px;
  background: rgba(255, 255, 255, 0.15);
}

.footer-bottom {
  text-align: center;
}

.copyright {
  margin: 0 0 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.infrastructure {
  margin: 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

// 移动端适配
@media (max-width: 1024px) {
  .footer-top {
    gap: 24px;
  }

  .footer-column {
    min-width: calc(50% - 12px);
  }

  .contact-column {
    flex: 1 1 100%;
    max-width: none;
  }
}

@media (max-width: 768px) {
  .footer-container {
    padding: 30px 16px 16px;
  }

  .footer-top {
    flex-direction: column;
    gap: 20px;
  }

  .footer-column {
    width: 100%;
    max-width: none;
  }

  .footer-title {
    margin-bottom: 12px;
  }

  .footer-links {
    gap: 8px;
  }

  .footer-link-item {
    font-size: 13px;
  }

  .contact-info {
    flex-direction: column;
    gap: 8px;
  }

  .contact-item {
    font-size: 13px;
  }

  .footer-divider {
    margin: 24px 0 16px;
  }

  .copyright {
    font-size: 12px;
  }

  .infrastructure {
    font-size: 11px;
  }
}
</style>
