/* 导航页面样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  background: 
    radial-gradient(circle at 20% 50%, rgba(94, 114, 228, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 119, 168, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(255, 206, 84, 0.1) 0%, transparent 50%),
    linear-gradient(135deg, #0f0f14 0%, #1a1a2e 50%, #16213e 100%);
  background-attachment: fixed;
  min-height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #e0e0e0;
  overflow-x: hidden;
  position: relative;
}

/* 添加动态背景效果 */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.02) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: 1;
}

/* 添加微妙的网格背景 */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
  z-index: 1;
}

/* —————— 时间与天气：移到左侧 —————— */
#timeAndWeather {
  position: absolute;
  top: 20px;
  left: 20px;
  text-align: left;
  z-index: 100;
  max-width: 400px;
  width: 100%;
  transition: all 0.3s ease;
}

#currentTime {
  font-size: 16px;
  margin-bottom: 8px;
  color: #ffffff;
  font-weight: 400;
}

#userLocation {
  font-size: 14px;
  margin-bottom: 8px;
  color: #ffffff;
  font-weight: 400;
  display: flex;
  align-items: center;
}

#userLocation::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-right: 5px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' width='20' height='20'%3E%3Cpath d='M 30 50 A 20 20 0 0 1 70 50 Z' fill='%23ffffff'/%3E%3Cpath d='M 30 50 L 70 50 L 50 80 Z' fill='%23ffffff'/%3E%3Ccircle cx='50' cy='40' r='6' fill='none' stroke='%230f0f14' stroke-width='2'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

#weatherContainer {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.weather-day {
  background: rgba(30, 30, 35, 0.6);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  min-width: 80px;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(80, 80, 100, 0.2);
}

.weather-date {
  font-weight: 500;
  color: #ffffff;
}

.weather-temp {
  margin-top: 2px;
  color: #ffffff;
}

.weather-condition {
  margin-top: 2px;
  color: #ffffff;
  font-size: 11px;
}

/* —————— 账户入口：右上角 —————— */
.account-entry {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(60, 60, 60, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.account-entry:hover {
  background: rgba(80, 80, 80, 0.9);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.account-icon {
  width: 24px;
  height: 24px;
  fill: #ffffff;
}

/* —————— 搜索框：参考谷歌搜索布局 —————— */
.search-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 700px;
  z-index: 100;
}

.site-title {
  font-size: 48px;
  font-weight: 300;
  color: #ffffff;
  margin-bottom: 24px;
  letter-spacing: 4px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  animation: fadeIn 1s ease-in-out;
}

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

.search-box {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 16px 110px 16px 20px;
  font-size: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  outline: none;
  background: rgba(60, 60, 60, 0.8);
  color: #ffffff;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.search-input:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  background: rgba(60, 60, 60, 0.9);
}

.search-input:focus {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  background: rgba(60, 60, 60, 1);
}

.search-input::placeholder {
  color: #aaa;
}

.search-btn {
  position: absolute;
  right: 8px;
  top: 8px;
  bottom: 8px;
  width: 90px;
  background: rgba(60, 60, 60, 0.8);
  color: #ffffff;
  border: 1px solid #ffffff;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.search-btn:hover {
  background: rgba(80, 80, 80, 0.9);
}

.engine-selector {
  margin-top: 24px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.engine-btn {
  padding: 10px 22px;
  background: rgba(40, 40, 45, 0.7);
  border: 1px solid rgba(80, 80, 90, 0.4);
  border-radius: 30px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: #ccc;
  backdrop-filter: blur(6px);
  transition: all 0.25s ease;
  min-width: 80px;
  text-align: center;
}

.engine-btn:hover {
  background: rgba(60, 60, 65, 0.8);
  border-color: rgba(100, 100, 110, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.engine-btn.active {
  background: #ffffff;
  color: #333333;
  border-color: transparent;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

/* —————— 网站导航：放在搜索框下方 —————— */
.categories {
  position: absolute;
  top: calc(50% + 180px); /* 增加与搜索框的间距，使布局更加居中 */
  left: 50%;
  transform: translateX(-50%);
  max-width: 1000px;
  width: calc(100% - 40px);
  z-index: 100;
  padding-bottom: 40px; /* 添加底部内边距，确保内容不会被截断 */
}

.category-title {
  font-size: 24px;
  font-weight: 300;
  margin: 40px 0 20px;
  padding: 8px 0;
  color: #f0f0f0;
  letter-spacing: 1px;
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  position: relative;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-title::before,
.category-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(94, 114, 228, 0.6), transparent);
}

.category-title::before {
  margin-right: 20px;
}

.category-title::after {
  margin-left: 20px;
}

.site-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.site-item {
  background: rgba(30, 30, 35, 0.7);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  position: relative;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.site-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  background: rgba(35, 35, 40, 0.9);
}

.site-link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.site-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.site-icon {
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
}

.site-name {
  font-weight: 500;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: 0.5px;
  color: #f0f0f0;
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  background: #0f0f14;
  color: #e0e0e0;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  z-index: 10;
  transition: opacity 0.3s, visibility 0.3s;
  margin-bottom: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  border: 1px solid #333;
}

.tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #0f0f14 transparent transparent transparent;
}

.site-item:hover .tooltip {
  visibility: visible;
  opacity: 1;
}

@media (max-width: 600px) {
  .search-input {
    padding: 16px 100px 16px 20px;
    font-size: 16px;
  }
  .search-btn {
    width: 90px;
    font-size: 14px;
  }
  .site-title {
    font-size: 36px;
    letter-spacing: 2px;
    margin-bottom: 20px;
  }
  .engine-btn {
    padding: 8px 16px;
    font-size: 14px;
    min-width: 70px;
  }
  .engine-selector {
    gap: 12px;
  }
  .site-list {
    grid-template-columns: repeat(2, 1fr);
  }
  .weather-day {
    min-width: 60px;
    padding: 8px 10px;
    font-size: 12px;
  }
  #timeAndWeather {
    transform: translate(-50%, -130px);
  }
  .categories {
    top: calc(50% + 160px); /* 在移动设备上调整位置 */
    padding-bottom: 30px;
  }
}