html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Arial, sans-serif;
  background-color: #f9f9f9;
}

.wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1;
}

.title {
  text-align: center;
  margin-top: 30px;
  color: #333;
}

.service-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start; /* 保证靠左对齐 */
  gap: 20px;
  padding: 40px;
  max-width: 1200px;
  margin: auto;
}

.service-box {
  flex: 0 0 calc(33.333% - 20px); /* 每行最多3个，减去gap */
  max-width: calc(33.333% - 20px);
  position: relative;
  height: 200px;
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  text-decoration: none;
  color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.service-box:hover {
  transform: scale(1.03);
}

.service-box .overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
  transition: background 0.3s ease;
}

.service-box:hover .overlay {
  background: rgba(0, 0, 0, 0.6);
}

.service-box h2 {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 15px;
  font-size: 18px;
  text-align: left;
  width: 100%;
}

@media (max-width: 768px) {
  .service-box {
    flex: 0 0 calc(50% - 20px); /* 平板时每行2个 */
    max-width: calc(50% - 20px);
  }
}

@media (max-width: 480px) {
  .service-box {
    flex: 0 0 100%; /* 手机时每行1个 */
    max-width: 100%;
  }
}
