/* ==================
   数据报表模块通用样式
   基于项目设计系统优化
 ==================== */

// 报表容器基础样式
.report-container {
  background: var(--sa-background-assist);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

// 报表头部样式
.report-header {
  padding: var(--sa-padding);
  background: var(--sa-background-assist);
  border-bottom: 1px solid var(--sa-border);
  
  .report-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--sa-title);
    margin: 0;
    line-height: 1.5;
  }
  
  .report-subtitle {
    font-size: 14px;
    color: var(--sa-subtitle);
    margin: 4px 0 0 0;
    line-height: 1.4;
  }
  
  .report-description {
    font-size: 12px;
    color: var(--sa-subfont);
    margin: 8px 0 0 0;
    line-height: 1.4;
  }
}

// 报表操作栏样式
.report-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px var(--sa-padding);
  background: var(--sa-background-assist);
  border-bottom: 1px solid var(--sa-border);
  
  .left-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    
    .report-title {
      font-size: 16px;
      font-weight: 600;
      color: var(--sa-title);
      margin: 0;
    }
    
    .report-desc {
      font-size: 12px;
      color: var(--sa-subfont);
      margin: 0;
    }
  }
  
  .right-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
  }
}

// 统计卡片样式
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
  
  .stats-card {
    background: var(--sa-background-assist);
    border: 1px solid var(--sa-border);
    border-radius: 8px;
    transition: all 0.3s ease;
    
    &:hover {
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
      transform: translateY(-2px);
    }
    
    .stats-content {
      display: flex;
      align-items: center;
      padding: 20px;
      
      .stats-icon {
        width: 48px;
        height: 48px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 16px;
        font-size: 24px;
        
        &.primary {
          background: var(--el-color-primary-light-9);
          color: var(--el-color-primary);
        }
        
        &.success {
          background: var(--el-color-success-light-9);
          color: var(--el-color-success);
        }
        
        &.warning {
          background: var(--el-color-warning-light-9);
          color: var(--el-color-warning);
        }
        
        &.danger {
          background: var(--el-color-danger-light-9);
          color: var(--el-color-danger);
        }
      }
      
      .stats-info {
        flex: 1;
        
        .stats-value {
          font-size: 28px;
          font-weight: 700;
          color: var(--sa-title);
          margin: 0 0 4px 0;
          line-height: 1.2;
        }
        
        .stats-label {
          font-size: 14px;
          color: var(--sa-subtitle);
          margin: 0;
        }
      }
      
      .stats-trend {
        display: flex;
        align-items: center;
        gap: 4px;
        font-size: 12px;
        font-weight: 500;
        
        &.up {
          color: var(--el-color-success);
        }
        
        &.down {
          color: var(--el-color-danger);
        }
        
        &.stable {
          color: var(--sa-subfont);
        }
      }
    }
  }
}

// 图表区域样式
.chart-area {
  background: var(--sa-background-assist);
  border: 1px solid var(--sa-border);
  border-radius: 8px;
  margin-bottom: 20px;
  
  .chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px var(--sa-padding);
    border-bottom: 1px solid var(--sa-border);
    
    .chart-title {
      font-size: 16px;
      font-weight: 600;
      color: var(--sa-title);
      margin: 0;
    }
    
    .chart-controls {
      display: flex;
      align-items: center;
      gap: 12px;
    }
  }
  
  .chart-container {
    padding: 20px;
    min-height: 300px;
    position: relative;
    
    .no-data {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      height: 300px;
      color: var(--sa-subfont);
      
      .no-data-icon {
        font-size: 48px;
        margin-bottom: 12px;
        opacity: 0.5;
      }
      
      .no-data-text {
        font-size: 14px;
      }
    }
  }
}

// 表格区域样式
.table-area {
  background: var(--sa-background-assist);
  border: 1px solid var(--sa-border);
  border-radius: 8px;
  
  .table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px var(--sa-padding);
    border-bottom: 1px solid var(--sa-border);
    
    .table-title {
      font-size: 16px;
      font-weight: 600;
      color: var(--sa-title);
      margin: 0;
    }
    
    .table-actions {
      display: flex;
      gap: 8px;
    }
  }
  
  .table-content {
    padding: 0;
  }
}

// 搜索区域样式
.search-section {
  background: var(--sa-background-assist);
  border: 1px solid var(--sa-border);
  border-radius: 8px;
  padding: 16px var(--sa-padding);
  margin-bottom: 16px;
  
  .search-form {
    .el-form-item {
      margin-bottom: 16px;
      
      &:last-child {
        margin-bottom: 0;
      }
    }
  }
  
  .search-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
  }
}

// 批量操作样式
.batch-actions {
  padding: 12px var(--sa-padding);
  background: var(--sa-background-hex-hover);
  border-bottom: 1px solid var(--sa-border);
  
  .batch-info {
    font-size: 12px;
    color: var(--sa-subfont);
    margin-bottom: 8px;
  }
  
  .batch-buttons {
    display: flex;
    gap: 8px;
  }
}

// 分页样式
.pagination-section {
  padding: 16px var(--sa-padding);
  background: var(--sa-background-assist);
  border-top: 1px solid var(--sa-border);
  display: flex;
  justify-content: flex-end;
}

// 对话框样式优化
.report-dialog {
  .el-dialog__header {
    background: var(--sa-background-assist);
    border-bottom: 1px solid var(--sa-border);
  }
  
  .el-dialog__body {
    background: var(--sa-background-assist);
  }
  
  .dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--sa-border);
  }
}

// 标签页样式优化
.dashboard-tabs {
  .tabs-header {
    background: var(--sa-background-assist);
    padding: 0 var(--sa-padding);
    border-bottom: 1px solid var(--sa-border);
    
    .el-tabs {
      .el-tabs__header {
        margin: 0;
      }
      
      .el-tabs__nav-wrap {
        &::after {
          display: none;
        }
      }
      
      .el-tabs__item {
        border: 1px solid var(--sa-border);
        border-bottom: none;
        background: var(--sa-background-hex-hover);
        color: var(--sa-subtitle);
        
        &.is-active {
          background: var(--sa-background-assist);
          color: var(--sa-title);
          border-color: var(--sa-border);
        }
        
        &:hover {
          color: var(--sa-title);
        }
      }
    }
  }
  
  .tabs-content {
    background: var(--sa-background-assist);
    min-height: 500px;
  }
}

// 响应式设计
@media (max-width: 768px) {
  .report-actions {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    
    .left-actions {
      flex-direction: column;
      gap: 8px;
      align-items: flex-start;
    }
    
    .right-actions {
      justify-content: flex-start;
      flex-wrap: wrap;
    }
  }
  
  .stats-cards {
    grid-template-columns: 1fr;
  }
  
  .chart-header {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .table-header {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .search-actions {
    justify-content: stretch;
    
    .el-button {
      flex: 1;
    }
  }
}

// 动画效果
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

.slide-up-enter-active,
.slide-up-leave-active {
  transition: all 0.3s ease;
}

.slide-up-enter-from {
  transform: translateY(20px);
  opacity: 0;
}

.slide-up-leave-to {
  transform: translateY(-20px);
  opacity: 0;
}