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

body {
  font-family: "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
  position: relative;
}

.container {
  max-width: 1600px; /* 进一步增加容器最大宽度 */
  margin: 0 auto;
  padding: 20px;
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 大屏幕时左右留出200px空间 */
@media (min-width: 1800px) {
  .container {
    padding-left: 200px;
    padding-right: 200px;
  }
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  position: relative; /* 确保main元素有定位上下文 */
}

/* 天气容器样式 */
.weather-container {
  background-color: rgba(255, 255, 255, 0.9);
  padding: 10px 15px;
  border-radius: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: absolute;
  z-index: 1010;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 天气位置类 */
.weather-top-right {
  top: 10px;
  right: 10px;
  text-align: right;
}

.weather-top-left {
  top: 20px;
  left: 20px;
}

.weather-top-center {
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
}

.weather-bottom-right {
  bottom: 20px;
  right: 20px;
}

.weather-bottom-left {
  bottom: 20px;
  left: 20px;
}

.weather-bottom-center {
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
}

/* 天气信息样式 */
.weather-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.weather-city {
  font-weight: bold;
  font-size: 14px;
  color: #333;
  display: flex;
  align-items: center;
}

.weather-temp {
  color: #ff6b6b;
  font-weight: bold;
  font-size: 14px;
  display: flex;
  align-items: center;
}

.weather-desc {
  color: #1890ff;
  font-size: 14px;
  display: flex;
  align-items: center;
}

.weather-air,
.weather-date,
.weather-wind {
  color: #52c41a;
  font-size: 14px;
  display: flex;
  align-items: center;
}

.weather-loading,
.weather-error {
  font-size: 14px;
  color: #666;
}

.weather-error {
  color: #ff6b6b;
}

/* 天气图标样式 */
.weather-icon {
  width: 20px;
  height: 20px;
  margin-right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.weather-icon svg {
  width: 100%;
  height: 100%;
}

.temp-icon {
  color: #ff6b6b;
}

.desc-icon {
  color: #1890ff;
}

.wind-icon {
  color: #52c41a;
}

.city-icon {
  color: #333;
}

/* 搜索容器样式 - 优化设计 */
.search-container {
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: 15px;
  padding: 20px 30px;
  margin: 30px 0 15px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 800px;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  position: relative; /* 确保定位上下文正确 */
  z-index: 1000; /* 增加整个搜索容器的z-index */
}

.search-container:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15); /* 悬停时增强阴影 */
  transform: translateY(-2px); /* 轻微上浮效果 */
}

.search-engines {
  display: flex;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(238, 238, 238, 0.6);
  padding-bottom: 12px;
  flex-wrap: wrap;
  justify-content: center; /* 居中显示搜索引擎 */
}

.search-engine {
  margin: 0 15px 8px; /* 调整间距 */
  padding: 6px 12px; /* 增加内边距 */
  cursor: pointer;
  border-radius: 20px; /* 圆形按钮效果 */
  transition: all 0.3s;
  display: flex;
  align-items: center;
}

.search-engine:hover {
  background-color: rgba(240, 240, 240, 0.7);
  transform: translateY(-2px); /* 悬停时轻微上浮 */
}

.search-engine.active {
  color: #1890ff;
  font-weight: bold;
  background-color: rgba(24, 144, 255, 0.1); /* 活跃状态背景色 */
}

.search-icon,
.icon,
.category-icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
  margin-right: 5px;
}

.search-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  margin-right: 5px;
}

.category-icon {
  width: 22px;
  height: 22px;
  margin-right: 8px;
}

.search-form {
  position: relative;
  display: flex;
  z-index: 1001; /* 增加搜索表单的z-index */
}

.search-form form {
  display: flex;
  width: 100%;
}

/* 搜索框和按钮透明度 */
.search-form input {
  flex: 1;
  padding: 12px 20px;
  border: 2px solid rgba(221, 221, 221, 0.7);
  border-radius: 25px 0 0 25px;
  font-size: 16px;
  outline: none;
  transition: all 0.3s;
  background-color: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05); /* 内阴影效果 */
}

.search-form input:focus {
  border-color: #1890ff;
  background-color: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 0 0 3px rgba(24, 144, 255, 0.1); /* 聚焦时添加光晕效果 */
}

.search-form button {
  background-color: rgba(24, 144, 255, 0.7);
  color: white;
  border: none;
  padding: 0 25px; /* 增加内边距 */
  border-radius: 0 25px 25px 0; /* 增加圆角 */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.search-form button:hover {
  background-color: rgba(24, 144, 255, 0.8);
  transform: translateX(2px); /* 悬停时轻微右移 */
}

.search-form button .icon {
  width: 22px;
  height: 22px;
  margin: 0;
}

.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: rgba(255, 255, 255, 0.98); /* 增加不透明度 */
  border: 1px solid rgba(221, 221, 221, 0.8);
  border-top: none;
  border-radius: 0 0 15px 15px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1002; /* 进一步增加z-index值 */
  display: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); /* 增强阴影 */
}

.search-suggestion-item {
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 1px solid rgba(240, 240, 240, 0.5);
}

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

.search-suggestion-item:hover,
.search-suggestion-item.selected {
  background-color: rgba(24, 144, 255, 0.05);
}

.search-suggestion-item strong {
  color: #1890ff;
  font-weight: bold;
}

/* 导航容器样式 - 与搜索容器宽度一致 */
.navigation-container {
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 30px;
  position: relative;
  z-index: 100; /* 确保导航容器的z-index低于搜索容器 */
}

.category {
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: 15px; /* 增加圆角 */
  padding: 20px; /* 增加内边距 */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); /* 调整阴影 */
  transition: all 0.3s ease;
  width: 100%;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.3); /* 添加微妙边框 */
}

.category:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.category h2 {
  margin-bottom: 20px; /* 增加间距 */
  padding-bottom: 12px; /* 增加间距 */
  border-bottom: 1px solid rgba(238, 238, 238, 0.6);
  color: #333;
  display: flex;
  align-items: center;
  font-size: 18px;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 15px; /* 增加间距 */
}

.nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #333;
  padding: 15px 10px; /* 增加内边距 */
  border-radius: 10px; /* 增加圆角 */
  transition: all 0.3s;
  text-align: center;
  background-color: rgba(255, 255, 255, 0.3); /* 添加微妙背景 */
  border: 1px solid rgba(255, 255, 255, 0.2); /* 添加微妙边框 */
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.nav-link .icon {
  font-size: 28px;
  margin-bottom: 10px; /* 增加间距 */
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1890ff;
}

.nav-link .favicon {
  width: 28px;
  height: 28px;
  margin-bottom: 10px; /* 增加间距 */
  object-fit: contain;
}

.nav-link span {
  font-size: 13px;
  line-height: 1.3;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

footer {
  margin-top: auto;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  padding: 20px 0;
  width: 100%;
}

footer a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 1250px) {
  .navigation-container {
    max-width: 100%;
  }
}

@media (max-width: 850px) {
  .search-container {
    max-width: 100%;
    padding: 20px;
  }
}

/* 热搜板块样式 */
.hot-searches-container {
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: 15px;
  padding: 0;
  margin: 10px 0 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 1200px;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

/* 热搜标签切换样式 */
.hot-searches-tabs {
  display: flex;
  overflow-x: auto;
  padding: 10px 15px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 15px 15px 0 0;
  border-bottom: 1px solid rgba(238, 238, 238, 0.6);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.hot-searches-tabs::-webkit-scrollbar {
  display: none;
}

.hot-searches-tab {
  display: flex;
  align-items: center;
  padding: 8px 15px;
  margin-right: 10px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 14px;
  transition: all 0.3s ease;
  background-color: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hot-searches-tab:last-child {
  margin-right: 0;
}

.hot-searches-tab.active {
  background-color: rgba(24, 144, 255, 0.1);
  color: #1890ff;
  font-weight: bold;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.hot-searches-tab:hover {
  background-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.hot-searches-panel {
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 0 0 15px 15px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-top: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

/* 图标颜色 */
.zhihu-icon {
  color: #0066ff;
}

.baidu-icon {
  color: #2932e1;
}

/* 热搜内容切换动画 */
.hot-searches-content {
  transition: opacity 0.3s ease;
}

.hot-searches-content.fade-out {
  opacity: 0;
}

.hot-searches-content.fade-in {
  opacity: 1;
}

/* 修改移动端天气样式 */
@media (max-width: 768px) {
  .hot-searches-tabs {
    padding: 8px 10px;
  }

  .hot-searches-tab {
    padding: 6px 12px;
    font-size: 13px;
  }
}

/* 修改移动端天气样式 */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  .search-engines {
    flex-wrap: wrap;
  }

  .search-engine {
    margin-bottom: 10px;
  }

  .weather-container {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    max-width: 100%;
    margin: 0 auto 30px;
    display: flex;
    justify-content: center;
    transform: none;
  }

  .weather-info {
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
    justify-content: center;
  }

  .weather-info::-webkit-scrollbar {
    display: none;
  }

  .weather-top-center,
  .weather-bottom-center {
    transform: none;
  }

  .search-container {
    margin: 20px 0 10px;
    padding: 15px;
  }

  .links-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }

  .category {
    padding: 15px;
  }

  .category h2 {
    font-size: 16px;
  }

  .nav-link {
    padding: 10px 5px;
  }

  .nav-link .icon,
  .nav-link .favicon {
    width: 24px;
    height: 24px;
  }

  .nav-link span {
    font-size: 12px;
  }

  .hot-searches-container {
    padding: 0;
  }
}

@media (max-width: 480px) {
  .links-grid {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 10px;
  }

  .search-form input {
    padding: 10px 15px;
    font-size: 14px;
  }

  .search-form button {
    padding: 0 15px;
  }

  .search-form button .icon {
    width: 18px;
    height: 18px;
  }
}

/* 移动端优化 */
@media (max-width: 480px) {
  .search-container {
    padding: 15px;
    margin: 15px 0 10px;
  }

  .search-engines {
    margin-bottom: 15px;
    padding-bottom: 10px;
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
  }

  .search-engines::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
  }

  .search-engine {
    margin: 0 8px;
    padding: 5px 10px;
    white-space: nowrap;
    font-size: 13px;
  }

  .search-form input {
    padding: 10px 15px;
    font-size: 14px;
  }

  .search-form button {
    padding: 0 15px;
  }

  .search-form button .icon {
    width: 18px;
    height: 18px;
  }
}

@media (min-width: 1200px) {
  .search-container {
    padding: 15px 30px;
    margin: 40px 0 30px;
  }

  .search-engines {
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  .search-form input {
    padding: 10px 20px;
  }

  .search-form button {
    padding: 0 20px;
  }
}
