.home-page {
  padding: 12px;
}

.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

// 导航栏样式
.nav-title {
  display: flex;
  width: 100%;
  justify-content: center;
}

.nav-text {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 18px;
  text-shadow: 0 2px 4px rgba(24, 142, 238, 0.2);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.error-tip {
  font-size: 12px;
  color: #f97316;
  background: #fef3c7;
  padding: 4px 8px;
  border-radius: 4px;
  margin-right: 8px;
}

.nav-button {
  padding: 8px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.2s;

  &:hover {
    background: #f3f4f6;
  }
}

// 统计卡片网格
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-card {
  background: white;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;

  &:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  }
}

.stat-label {
  font-size: 14px;
  color: #333;
  line-height: 1.2;
  font-weight: bold;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: #3b82f6;
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.progress-bar {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #3b82f6;
  border-radius: 2px;
  transition: width 0.3s ease;
}

// Loading状态样式
.stat-card {
  .stat-label:empty::before {
    content: "";
    display: block;
    width: 60px;
    height: 12px;
    background: #f0f0f0;
    border-radius: 2px;
    animation: pulse 1.5s ease-in-out infinite;
  }

  .stat-value {
    span:empty::before {
      content: "";
      display: block;
      width: 40px;
      height: 20px;
      background: #f0f0f0;
      border-radius: 2px;
      animation: pulse 1.5s ease-in-out infinite;
    }

    div:empty::before {
      content: "";
      display: block;
      width: 20px;
      height: 20px;
      background: #f0f0f0;
      border-radius: 4px;
      animation: pulse 1.5s ease-in-out infinite;
    }
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

// 通用区域样式
.section {
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;

  &:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }
}

.section-header {
  margin-bottom: 12px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  position: relative;
  padding-left: 8px;

  &::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 14px;
    background: var(--primary-gradient);
    border-radius: 2px;
  }
}

// 场景统计网格
.scene-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.scene-item {
  text-align: center;
  padding: 8px 4px;
}

.scene-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.scene-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.scene-value {
  font-size: 16px;
  font-weight: 700;
  color: #333;
  margin-bottom: 2px;
  line-height: 1.2;
}

.scene-label {
  font-size: 10px;
  color: #666;
  line-height: 1.2;
}

// 今日数据网格
.today-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.today-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;

  &:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
}

.today-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: white;
  border-radius: 50%;
  flex-shrink: 0;
}

.today-value {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  line-height: 1.2;
}

.today-label {
  font-size: 12px;
  color: #666;
  line-height: 1.2;
}

// 图表容器
.chart-container {
  width: 100%;
  min-height: 160px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 12px;
}

// 响应式设计
@media (max-width: 375px) {
  .home-page {
    padding: 8px;
  }

  .stats-grid {
    gap: 6px;
    margin-bottom: 12px;
  }

  .stat-card {
    padding: 10px 6px;
  }

  .stat-icon {
    width: 28px;
    height: 28px;
  }

  .stat-value {
    font-size: 16px;
  }

  .stat-label {
    font-size: 10px;
  }

  .section {
    padding: 12px;
    margin-bottom: 8px;
  }

  .scene-grid,
  .today-grid {
    gap: 6px;
  }

  .scene-icon {
    width: 32px;
    height: 32px;
  }

  .scene-value {
    font-size: 14px;
  }

  .scene-label {
    font-size: 9px;
  }

  .today-value {
    font-size: 12px;
  }

  .today-label {
    font-size: 9px;
  }

  .chart-container {
    min-height: 140px;
    padding: 8px;
  }
}
