* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background-color: #f5f5f5;
}

/* 顶部导航样式 */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 50px;
  background: #fff;
}

/* 主导航菜单样式 */
.main-nav {
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 40px;
}

.nav-list li a {
  display: block;
  padding: 15px 0;
  text-decoration: none;
  color: #333;
  font-size: 16px;
  position: relative;
  transition: color 0.3s;
}

.nav-list li a.active {
  color: #0099ff;
}

.nav-list li a.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #0099ff;
}

.nav-list li a:hover {
  color: #0099ff;
}

/* 主要内容区样式 */
main {
  display: flex;
  max-width: 1200px;
  margin: 20px auto;
  gap: 20px;
}

.service-menu {
  width: 240px;
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.menu-title {
  background: #0099ff;
  color: white;
  padding: 15px 20px;
  font-size: 16px;
  font-weight: bold;
}

.service-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.service-menu > ul > li {
  position: relative;
  border-bottom: 1px solid #f0f0f0;
}

.service-menu > ul > li > a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s ease;
  background: #f9f9f9;
}

.service-menu > ul > li:hover > a {
  color: #0099ff;
  background: white;
}

.arrow {
  color: #999;
  font-size: 12px;
}

.submenu {
  position: absolute;
  left: 240px;
  top: 0;
  width: 720px;
  background: white;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
  display: none;
  z-index: 1000;
  padding: 20px;
  border-radius: 4px;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.grid-item {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-item a {
  text-decoration: none;
  color: #666;
  font-size: 13px;
  padding: 8px 15px;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.grid-item a:hover {
  color: #0099ff;
  background: #f5f9ff;
  border-radius: 4px;
}

/* 显示子菜单的动画效果 */
.service-menu > ul > li:hover .submenu {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* 添加响应式阴影效果 */
.submenu:before {
  content: "";
  position: absolute;
  left: -8px;
  top: 20px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 8px 8px 0;
  border-color: transparent white transparent transparent;
}

/* 中间轮播图 */
.banner {
  flex-grow: 1;
}

.banner img {
  width: 100%;
  border-radius: 4px;
}

/* 服务列表区域样式 */
.service-list {
  padding: 15px;
  background: #f5f5f5;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

/* 服务块样式 */
.service-block {
  width: calc((100% - 40px) / 3); /* 减去两个间隔的20px，平分成3份 */
  background: #fff;
  border-radius: 8px;
  padding: 15px;
}

/* 块标题样式 */
.block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.block-header h3 {
  font-size: 16px;
  color: #333;
}

.all-btn {
  color: #999;
  font-size: 14px;
  padding: 2px 8px;
  background: #f5f5f5;
  border-radius: 12px;
}

/* 服务列表区域样式 */
.service-list {
  padding: 15px;
  background: #f5f5f5;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

/* 服务块样式 */
.service-block {
  width: calc((100% - 20px) / 2); /* 一行两个 */
  background: #fff;
  border-radius: 8px;
  padding: 20px;
}

/* 块标题样式 */
.block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 0 10px;
}

.block-header h3 {
  font-size: 16px;
  color: #333;
}

.all-btn {
  color: #999;
  font-size: 14px;
  background: #f5f5f5;
  padding: 2px 12px;
  border-radius: 15px;
}

/* 服务列表区域样式 */
.service-list {
  max-width: 1200px; /* 设置最大宽度 */
  margin: 0 auto; /* 居中显示 */
  padding: 15px;
  background: #f5f5f5;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

/* 服务块样式 */
.service-block {
  width: calc((100% - 20px) / 2); /* 两列布局 */
  max-width: 580px; /* 限制最大宽度 */
  background: #fff;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 块标题样式 */
.block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding: 0 10px;
}

.block-header h3 {
  font-size: 16px;
  color: #333;
}

.all-btn {
  color: #999;
  font-size: 12px;
  background: #f5f5f5;
  padding: 2px 10px;
  border-radius: 12px;
}

/* 服务项目布局 */
.service-items {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  padding: 0 5px;
}

.item {
  width: calc((100% - 30px) / 3); /* 一行3个 */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.item img {
  width: 154px;
  height: 83px;
  border-radius: 50%;
  margin-bottom: 8px;
}

.item span {
  font-size: 13px;
  color: #333;
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
  .service-block {
    width: 100%;
  }

  .item img {
    width: 154px;
    height: 83px;
  }
}
/* 添加背景色 */
.service-block {
  background: #fff;
}

/* 添加边框和圆角 */
.service-block {
  border-radius: 4px;
  border: 1px solid #f0f0f0;
}
/* 添加hover效果 */
.item:hover {
  cursor: pointer;
}

.item:hover span {
  color: #0099ff;
}

/* 分隔线 */
.service-block {
  border: 1px solid #f0f0f0;
}

/* 全部按钮hover效果 */
.all-btn:hover {
  background: #e5e5e5;
  cursor: pointer;
}

.quick-links {
  width: 100%; /* 确保宽度与上面的服务列表一致 */
  display: flex;
  justify-content: space-between; /* 使内容均匀分布 */
  padding: 20px 0; /* 添加一些内边距 */
  background-color: #fff; /* 设置背景颜色 */
}

.hot-cities,
.friend-links {
  display: flex;
  align-items: center;
  padding: 5px 0;
}

.label {
  color: #333;
  font-size: 14px;
  margin-right: 10px;
  white-space: nowrap;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.links a {
  color: #666;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s;
}

.links a:hover {
  color: #0099ff;
}

/* 分隔线 */
.hot-cities {
  border-bottom: 1px solid #eee;
  margin-bottom: 5px;
  padding-bottom: 5px;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .quick-links {
    padding: 10px;
  }

  .hot-cities,
  .friend-links {
    flex-direction: column;
    align-items: flex-start;
  }

  .label {
    margin-bottom: 5px;
  }

  .links {
    gap: 10px;
  }
}

.item > a {
  text-decoration: none;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    /* 隐藏左侧维修分类菜单 */
    .service-menu {
        display: none;
    }

    /* 调整主要内容区域布局 */
    main {
        padding: 0;
        margin: 0;
    }

    /* 调整服务列表布局 */
    .service-list {
        margin: 0;
        padding: 10px;
    }

    /* 调整服务块布局 */
    .service-block {
        width: 100%;
        margin-bottom: 10px;
    }

    /* 调整服务项目布局 */
    .service-items {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .item {
        width: 100%;
    }

    .item img {
        width: 100%;
        height: auto;
        max-width: 100px;
    }

    /* 优化底部链接样式 */
    .quick-links {
        margin-top: 15px;
        padding: 15px;
        background: #fff;
    }

    .hot-cities,
    .friend-links {
        width: 100%;
        margin-bottom: 15px;
    }

    .label {
        display: block;
        margin-bottom: 10px;
        font-size: 15px;
        color: #333;
        font-weight: bold;
    }

    .links {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
    }

    .links a {
        display: inline-block;
        padding: 6px 12px;
        background: #f5f5f5;
        border-radius: 15px;
        font-size: 13px;
        color: #666;
        white-space: normal;
        line-height: 1.3;
    }

    .links a:active {
        background: #e5e5e5;
        color: #0099ff;
    }

    /* 移除底部边框 */
    .hot-cities {
        border-bottom: 1px solid #eee;
        padding-bottom: 15px;
    }
}
