<template>
  <div class="cross-container">
    <!-- 页面标题 -->
    <div class="section-header">
      <div class="section-icon">📊</div>
      <h1 class="page-title">韶关市河流断面水质监测分析系统</h1>
    </div>
    
    <!-- 地图展示区域 -->
    <div class="dashboard-section">
      <div class="section-header">
        <div class="section-icon">🗺️</div>
        <h2 class="component-title">断面空间分布图</h2>
      </div>
      <div class="dashboard-card map-card">
        <div class="map-holder">
          <crosssectionmap/>
        </div>
      </div>
    </div>
    
    <!-- 表格区域 - 上下排列 -->
    <div class="tables-section">
      <!-- 断面数据详情 -->
      <div class="dashboard-section table-section">
        <div class="section-header">
          <div class="section-icon">📋</div>
          <h2 class="component-title">断面水质数据详情</h2>
          <div class="table-info">
            <span class="info-item">数据更新时间: 2025-08-16</span>
          </div>
        </div>
        <div class="dashboard-card data-card">
          <div class="table-container">
            <CrossSectionSamplelineData/>
          </div>
        </div>
      </div>
      
      <!-- 河流Cd浓度分析 -->
      <div class="dashboard-section table-section">
        <div class="section-header">
          <div class="section-icon">📈</div>
          <h2 class="component-title">河流Cd浓度分析</h2>
          <div class="analysis-legend">
            <div class="legend-item">
              <div class="legend-color cadmium"></div>
              <span>镉(Cd)浓度</span>
            </div>
          </div>
        </div>
        <div class="dashboard-card chart-card">
          <div class="chart-header">
            <h3>各河流Cd平均浓度对比</h3>
            <p>韶关市主要河流镉元素含量分布</p>
          </div>
          <div class="chart-container">
            <CrossSetionData1/>
          </div>
        </div>
      </div>
      
      <!-- 区县Cd浓度分析 -->
      <div class="dashboard-section table-section">
        <div class="section-header">
          <div class="section-icon">📉</div>
          <h2 class="component-title">区县Cd浓度分析</h2>
          <div class="analysis-legend">
            <div class="legend-item">
              <div class="legend-color cadmium"></div>
              <span>镉(Cd)浓度</span>
            </div>
          </div>
        </div>
        <div class="dashboard-card chart-card">
          <div class="chart-header">
            <h3>各区县Cd平均浓度对比</h3>
            <p>韶关市行政区划镉元素含量分布</p>
          </div>
          <div class="chart-container">
            <CrossSetionData2/>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import CrossSectionSamplelineData from '@/components/irrpollution/crossSectionSamplelineData.vue'
import CrossSetionData1 from '@/components/irrpollution/crossSetionData1.vue';
import CrossSetionData2 from '@/components/irrpollution/crossSetionData2.vue';
import crosssectionmap from '@/components/irrpollution/crosssectionmap.vue';
</script>

<style scoped>
/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

.cross-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: linear-gradient(135deg, #f0f9ff 0%, #e6f7ff 100%);
  padding: 25px;
  gap: 30px;
  position: relative;
  overflow-x: hidden;
}

/* 页面标题 */
.section-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  position: relative;
}

.page-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: #1a365d;
  margin: 0;
  position: relative;
  padding-left: 15px;
  flex-grow: 1;
}

.page-title::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 100px;
  height: 4px;
  background: linear-gradient(90deg, #4a9ef7, #3acfd5);
  border-radius: 2px;
}

.section-icon {
  font-size: 2.5rem;
  color: #3a9fd3;
}

/* 主内容区 */
.dashboard-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 卡片设计 */
.dashboard-card {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 20px rgba(0, 60, 120, 0.12);
  transition: all 0.4s ease;
  overflow: hidden;
  position: relative;
}

.dashboard-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0, 60, 120, 0.18);
}

/* 地图容器 */
.map-card {
  height: 550px;
  position: relative;
}

.map-holder {
  position: relative;
  height: 100%;
  z-index: 100;
}

/* 表格区域 */
.tables-section {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* 数据卡片 - 添加滚动条 */
.data-card {
  height: 550px;
  padding: 0; /* 移除内边距 */
  display: flex;
  flex-direction: column;
}

.table-container {
  flex: 1;
  overflow-y: auto; /* 添加垂直滚动条 */
  padding: 15px;
}

/* 图表卡片 */
.chart-card {
  height: 600px;
  padding: 0; /* 移除内边距 */
  display: flex;
  flex-direction: column;
}

.chart-container {
  flex: 1;
  overflow: hidden; /* 确保图表不会溢出 */
  padding: 20px;
}

.chart-header {
  margin-bottom: 15px;
  padding: 20px 20px 10px;
  border-bottom: 1px solid #e2e8f0;
}

.chart-header h3 {
  font-size: 1.4rem;
  color: #1a365d;
  margin: 0 0 5px 0;
}

.chart-header p {
  font-size: 1rem;
  color: #718096;
  margin: 0;
}

/* 组件标题 */
.component-title {
  font-size: 1.6rem;
  font-weight: 600;
  color: #1a365d;
  position: relative;
  padding-left: 10px;
}

.component-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 80%;
  background: linear-gradient(to bottom, #4a9ef7, #3acfd5);
  border-radius: 2px;
}

.table-info {
  display: flex;
  gap: 20px;
  margin-left: 30px;
  font-size: 0.9rem;
  color: #4a5568;
}

.analysis-legend {
  display: flex;
  gap: 15px;
  margin-left: 30px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

.cadmium {
  background-color: #ff6b6b;
}

/* 页脚区域 */
.footer-section {
  margin-top: 30px;
  padding: 20px 0;
  text-align: center;
  color: #546e7a;
  font-size: 1rem;
  border-top: 1px solid #e2e8f0;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 10px;
  font-size: 0.9rem;
  color: #78909c;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .map-card {
    height: 500px;
  }
  
  .data-card,
  .chart-card {
    height: 500px;
  }
}

@media (max-width: 900px) {
  .page-title {
    font-size: 1.8rem;
  }
  
  .component-title {
    font-size: 1.4rem;
  }
  
  .data-card,
  .chart-card {
    height: 450px;
  }
}

@media (max-width: 768px) {
  .cross-container {
    padding: 15px;
    gap: 20px;
  }
  
  .section-header {
    flex-wrap: wrap;
  }
  
  .page-title {
    font-size: 1.6rem;
    width: 100%;
    padding-left: 0;
  }
  
  .component-title {
    font-size: 1.3rem;
  }
  
  .map-card {
    height: 450px;
  }
  
  .data-card,
  .chart-card {
    height: 350px;
  }
  
  .table-info,
  .analysis-legend {
    margin-left: 0;
    margin-top: 10px;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 1.5rem;
  }
  
  .component-title {
    font-size: 1.2rem;
  }
  
  .map-card {
    height: 400px;
  }
  
  .data-card,
  .chart-card {
    height: 300px;
  }
  
  .footer-links {
    flex-direction: column;
    gap: 5px;
  }
}
</style>