/**
 * 分析仪表板样式
 */

.analytics-dashboard {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 16px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 头部 */
.analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.analytics-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 2rem;
  font-weight: 700;
  color: #2c3e50;
  margin: 0;
}

.analytics-title i {
  color: #3498db;
}

.analytics-actions {
  display: flex;
  gap: 10px;
}

.btn-export,
.btn-clear {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-export {
  background: #3498db;
  color: white;
}

.btn-export:hover {
  background: #2980b9;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.btn-clear {
  background: #e74c3c;
  color: white;
}

.btn-clear:hover {
  background: #c0392b;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

/* 概览卡片 */
.analytics-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.overview-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  border-left: 4px solid #3498db;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.overview-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.card-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-icon i {
  font-size: 1.5rem;
}

.card-content {
  flex: 1;
}

.card-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #2c3e50;
  line-height: 1;
  margin-bottom: 5px;
}

.card-title {
  font-size: 0.85rem;
  color: #7f8c8d;
  font-weight: 500;
}

/* 图表区域 */
.analytics-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.chart-section,
.detail-section {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chart-title,
.detail-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #ecf0f1;
}

.chart-title i,
.detail-title i {
  color: #3498db;
}

.chart-content {
  min-height: 200px;
}

/* 热门列表 */
.top-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.top-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.top-item:hover {
  background: #e9ecef;
  transform: translateX(5px);
}

.top-rank {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.top-content {
  flex: 1;
  min-width: 0;
}

.top-name {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-name a {
  color: inherit;
  text-decoration: none;
}

.top-name a:hover {
  color: #3498db;
}

.top-path {
  font-size: 0.8rem;
  color: #7f8c8d;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #3498db;
  flex-shrink: 0;
}

.top-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #ecf0f1;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.top-item {
  position: relative;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3498db 0%, #2980b9 100%);
  transition: width 0.3s ease;
}

/* 详情区域 */
.analytics-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.detail-content {
  min-height: 150px;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
}

.info-label {
  font-size: 0.9rem;
  color: #7f8c8d;
  font-weight: 500;
}

.info-value {
  font-size: 0.95rem;
  color: #2c3e50;
  font-weight: 600;
  text-align: right;
}

/* 无数据 */
.no-data {
  text-align: center;
  padding: 40px 20px;
  color: #7f8c8d;
  font-size: 0.95rem;
}

.no-data::before {
  content: '\f05e';
  font-family: 'FontAwesome';
  font-size: 2rem;
  display: block;
  margin-bottom: 10px;
  color: #95a5a6;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .analytics-dashboard {
    padding: 20px 15px;
  }

  .analytics-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .analytics-title {
    font-size: 1.5rem;
  }

  .analytics-actions {
    width: 100%;
  }

  .btn-export,
  .btn-clear {
    flex: 1;
    justify-content: center;
  }

  .analytics-overview {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .analytics-charts,
  .analytics-details {
    grid-template-columns: 1fr;
  }

  .overview-card {
    padding: 15px;
  }

  .card-value {
    font-size: 1.5rem;
  }

  .top-item {
    padding: 10px;
  }

  .info-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .info-value {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .analytics-overview {
    grid-template-columns: 1fr;
  }

  .overview-card {
    padding: 12px;
  }

  .card-icon {
    width: 40px;
    height: 40px;
  }

  .card-icon i {
    font-size: 1.2rem;
  }

  .card-value {
    font-size: 1.3rem;
  }
}

/* 暗色模式适配 */
.dark-mode .analytics-dashboard {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.dark-mode .analytics-header {
  border-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .analytics-title {
  color: #ecf0f1;
}

.dark-mode .overview-card,
.dark-mode .chart-section,
.dark-mode .detail-section {
  background: rgba(255, 255, 255, 0.05);
}

.dark-mode .card-value,
.dark-mode .info-value {
  color: #ecf0f1;
}

.dark-mode .card-title,
.dark-mode .info-label {
  color: #bdc3c7;
}

.dark-mode .chart-title,
.dark-mode .detail-title {
  color: #ecf0f1;
  border-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .top-item {
  background: rgba(255, 255, 255, 0.05);
}

.dark-mode .top-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.dark-mode .top-name {
  color: #ecf0f1;
}

.dark-mode .top-path {
  color: #95a5a6;
}

.dark-mode .info-item {
  background: rgba(255, 255, 255, 0.05);
}

.dark-mode .no-data {
  color: #95a5a6;
}

/* 动画优化 */
@media (prefers-reduced-motion: reduce) {
  .analytics-dashboard,
  .overview-card,
  .top-item {
    animation: none;
  }
}