/* 基础布局样式 */
.filter-controls {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 16px;
}

/* 统计卡片样式 */
nz-card {
  margin-bottom: 16px;
  border-radius: 4px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

nz-card[nzTitle]::before {
  content: none;
}

/* 统计数字样式 */
nz-statistic {
  text-align: center;
}

.statistic-subtext {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.45);
  text-align: center;
  margin-top: -8px;
}

/* 图表容器样式 */
.chart-container {
  position: relative;
  width: 100%;
  min-height: 400px;
  margin-top: 8px;
}

/* 表格样式优化 */
nz-table {
  width: 100%;
  overflow-x: auto;
  margin-top: 16px;
}

nz-table th {
  white-space: nowrap;
  background-color: #fafafa;
  font-weight: 500;
  padding: 12px 16px !important;
}

nz-table td {
  white-space: nowrap;
  padding: 12px 16px !important;
  transition: background-color 0.3s;
}

nz-table tr:hover td {
  background-color: #f5f5f5;
}

/* 表格链接样式 */
nz-table a {
  color: #1890ff;
  cursor: pointer;
  text-decoration: none;
}

nz-table a:hover {
  text-decoration: underline;
}

/* 进度条样式 */
nz-progress {
  display: inline-block;
  width: 80px;
  margin-right: 8px;
  vertical-align: middle;
}

/* 特殊列样式 */
.strategy-name-col,
.template-name-col {
  min-width: 150px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.display-count-column {
  color: #faad14;
  font-weight: 500;
}

.display-rate-column {
  background-color: rgba(250, 173, 20, 0.05);
}

.click-rate-column {
  background-color: rgba(114, 46, 209, 0.05);
}

/* 空状态样式 */
nz-empty {
  margin: 40px 0;
}

/* 标签页样式 */
nz-tabset {
  margin-top: 16px;
}

nz-tabs-nav {
  margin-bottom: 0;
}

/* 展开行样式 */
.expanded-row {
  padding: 0 !important;
  background-color: #fafafa;
}

.expanded-content {
  width: 100%;
  overflow-x: auto;
}

.expanded-table {
  width: 100%;
  margin: 0;
}

/* 确保子表格与父表格对齐 */
.expanded-table th,
.expanded-table td {
  padding: 8px 16px !important;
  white-space: nowrap;
}

/* 展开图标样式 */
.expand-icon-cell {
  width: 60px;
  text-align: center;
  cursor: pointer;
}

.expand-icon {
  transition: transform 0.3s;
}

.expand-icon.expanded {
  transform: rotate(90deg);
}

/* 子表格样式 */
.expanded-table nz-table {
  background-color: transparent;
}

.expanded-table th {
  background-color: #f5f5f5 !important;
}

/* 加载状态样式 */
.loading-container {
  padding: 16px;
  text-align: center;
}

/* 图表图例样式 */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  margin-top: 16px;
  gap: 16px;
  justify-content: center;
}

.chart-legend div {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.65);
}

.legend-color {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border-radius: 2px;
}

.legend-line {
  display: inline-block;
  width: 20px;
  height: 0;
  border-bottom: 2px solid;
  margin-right: 6px;
}

/* 响应式调整 */
@media (max-width: 1600px) {
  nz-table {
    font-size: 13px;
  }

  nz-table th,
  nz-table td {
    padding: 8px 12px !important;
  }

  nz-progress {
    width: 100%;
    margin-right: 0;
    margin-bottom: 4px;
  }
}

@media (max-width: 1200px) {
  nz-table {
    font-size: 12px;
  }

  nz-progress {
    width: 60px;
  }

  .statistic-subtext {
    font-size: 11px;
  }
}

@media (max-width: 768px) {
  .chart-container {
    min-height: 300px;
  }

  nz-table {
    font-size: 11px;
  }

  nz-table td,
  nz-table th {
    padding: 8px !important;
  }

  .filter-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-controls nz-range-picker {
    width: 100%;
    margin-right: 0;
    margin-bottom: 8px;
  }

  nz-statistic {
    margin-bottom: 8px;
  }

  .chart-legend {
    gap: 8px;
    justify-content: flex-start;
  }

  .chart-legend div {
    font-size: 11px;
  }
}

/* 状态颜色 */
.status-success {
  color: #52c41a;
}

.status-warning {
  color: #faad14;
}

.status-error {
  color: #ff4d4f;
}

/* 加载动画 */
nz-spin {
  display: block;
  min-height: 200px;
}

/* 卡片标题样式 */
nz-card[nzTitle] {
  border-top: 3px solid #1890ff;
}
