/* 库存统计页面样式 */
.inventory-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* 统计卡片样式 */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.stats-card {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.stats-card-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.stats-card-success {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: white;
}

.stats-card-warning {
  background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
  color: white;
}

.stats-card-danger {
  background: linear-gradient(135deg, #fc5c7d 0%, #6a82fb 100%);
  color: white;
}

.stats-card .value {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.stats-card .label {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* 图表容器 */
.chart-container {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
  height: 400px;
}

/* 库存商品表格 */
.inventory-table-container {
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.inventory-table {
  width: 100%;
  border-collapse: collapse;
}

.inventory-table th,
.inventory-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #dee2e6;
}

.inventory-table th {
  background-color: var(--light-color);
  font-weight: 600;
}

.inventory-table tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.low-stock {
  color: var(--danger-color);
  font-weight: bold;
}

.out-of-stock {
  color: var(--danger-color);
  text-decoration: line-through;
}

.high-value {
  color: var(--success-color);
  font-weight: bold;
}

/* 排名列表样式 */
.rankings-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.ranking-list {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.ranking-list h4 {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #dee2e6;
}

.ranking-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f8f9fa;
}

.ranking-item:last-child {
  border-bottom: none;
}

.ranking-item .rank {
  font-weight: bold;
  color: var(--primary-color);
  width: 30px;
}

.ranking-item .name {
  flex: 1;
  margin: 0 1rem;
}

.ranking-item .value {
  font-weight: bold;
}

.top-3 .rank {
  color: var(--warning-color);
}

/* 搜索和筛选样式 */
.search-filters {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 1rem;
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.filter-item {
  flex: 1;
  min-width: 200px;
}

.filter-item .form-control,
.filter-item .form-select {
  border-radius: 8px;
  padding: 0.5rem;
}

/* 趋势分析样式 */
.trends-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.trend-chart {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 响应式设计 - 库存页面 */
@media (max-width: 575.98px) {
  .stats-cards {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .stats-card {
    padding: 1rem;
  }
  
  .stats-card .value {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
  }
  
  .stats-card .label {
    font-size: 0.8rem;
  }
  
  .chart-container {
    padding: 1rem;
    height: 250px;
  }
  
  .inventory-table th,
  .inventory-table td {
    padding: 0.5rem;
    font-size: 0.8rem;
  }
  
  .inventory-table-container {
    overflow-x: auto;
  }
  
  .rankings-container {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .ranking-list {
    padding: 1rem;
  }
  
  .ranking-list h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
  }
  
  .ranking-item {
    padding: 0.25rem 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .ranking-item .rank {
    width: auto;
    margin-bottom: 0.25rem;
  }
  
  .ranking-item .name {
    margin: 0 0 0.25rem 0;
    word-break: break-word;
  }
  
  .trends-container {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .trend-chart {
    padding: 1rem;
  }
  
  .search-filters {
    flex-direction: column;
    padding: 0.75rem;
    gap: 0.75rem;
  }
  
  .filter-item {
    min-width: 100%;
    width: 100%;
  }
  
  .filter-item .form-control,
  .filter-item .form-select {
    padding: 0.5rem;
    font-size: 0.85rem;
  }
}

@media (min-width: 576px) and (max-width: 767.98px) {
  .stats-cards {
    grid-template-columns: 1fr;
  }
  
  .rankings-container {
    grid-template-columns: 1fr;
  }
  
  .trends-container {
    grid-template-columns: 1fr;
  }
  
  .search-filters {
    flex-direction: column;
  }
  
  .filter-item {
    min-width: 100%;
  }
  
  .chart-container {
    height: 300px;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .stats-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .trends-container {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 992px) {
  .trends-container {
    grid-template-columns: repeat(2, 1fr);
  }
}