/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: url('https://wp.upx8.com/api.php?content=风景') no-repeat center center fixed;
  background-size: cover;
  color: #333;
  min-height: 100vh;
  overflow-x: hidden;
}

/* 玻璃模糊效果基础类 */
.glass-effect {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  /* 优化渲染性能，减少白色线条 */
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-font-smoothing: subpixel-antialiased;
  /* 避免模糊边缘导致的问题 - 修改为visible，确保不裁剪搜索建议 */
  overflow: visible;
  /* 修复可能的渲染断层 */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
  /* 设置一个较低的z-index，确保搜索建议能显示在上面 */
  z-index: 1;
}

/* 主容器 */
#app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  padding-bottom: 50px; /* 增加底部预留空间，避免与固定footer重合 */
}

/* 顶部导航栏 */
.top-nav {
  display: flex;
  align-items: center;
  margin-bottom: 40px;
  padding: 15px 30px;
}

.nav-content {
  display: flex;
  align-items: center;
  gap: 30px;
  width: 100%;
}

.main-title {
  font-size: 28px;
  margin: 0;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

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

.top-nav a {
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 8px 16px;
  border-radius: 8px;
}

.top-nav a:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* 标题区域 */
.title-section {
  text-align: center;
  margin-bottom: 30px;
  padding: 30px;
  /* 避免重排导致的闪烁 */
  overflow: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.time-display {
  font-size: 36px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 10px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  /* 固定宽度，避免数字变化导致的宽度跳动 */
  min-width: 180px;
  display: block;
  margin-left: auto;
  margin-right: auto;
  /* 硬件加速，减少渲染问题 */
  backface-visibility: hidden;
  transform: translateZ(0);
}

.date-display {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 15px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  /* 固定宽度，避免日期变化导致的宽度跳动 */
  min-width: 200px;
  display: block;
  margin-left: auto;
  margin-right: auto;
  /* 硬件加速，减少渲染问题 */
  backface-visibility: hidden;
  transform: translateZ(0);
}

.runtime-display {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  /* 硬件加速，减少渲染问题 */
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* 搜索分类区域 */
.search-category {
  margin-bottom: 40px;
  padding: 20px;
  /* 确保不裁剪搜索建议 */
  overflow: visible;
  position: relative;
}

/* 搜索头部 */
.search-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-title {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 搜索按钮组 */
.search-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.quick-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.quick-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 1);
}

.quick-btn.active {
  background: rgba(0, 120, 212, 0.9);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 120, 212, 0.3);
}

.quick-btn.active:hover {
  background: rgba(0, 120, 212, 1);
}

/* 搜索输入区域 */
.search-input-wrapper {
  display: flex;
  gap: 0;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  border-radius: 30px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  border: 2px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input-wrapper:focus-within {
  box-shadow: 0 8px 32px rgba(0, 120, 212, 0.25);
  background: rgba(255, 255, 255, 1);
  border-color: rgba(0, 120, 212, 0.6);
  transform: translateY(-2px);
}

.search-box {
  flex: 1;
  padding: 16px 24px;
  border: none;
  border-radius: 30px 0 0 30px;
  font-size: 16px;
  font-weight: 400;
  color: #333;
  background: transparent;
  outline: none;
  transition: all 0.3s ease;
  /* 添加占位符样式 */
}

.search-box::placeholder {
  color: #999;
  font-weight: 300;
}

.search-box:focus {
  color: #111;
}

.search-btn {
  padding: 16px 32px;
  border: none;
  border-radius: 0 30px 30px 0;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #0078d4 0%, #00a4ef 100%);
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 120, 212, 0.3);
  position: relative;
  overflow: hidden;
}

.search-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.search-btn:hover {
  background: linear-gradient(135deg, #0066b3 0%, #008ad1 100%);
  box-shadow: 0 6px 16px rgba(0, 120, 212, 0.4);
  transform: translateX(2px);
}

.search-btn:hover::before {
  left: 100%;
}

.search-btn:active {
  transform: translateX(0) scale(0.98);
  box-shadow: 0 2px 8px rgba(0, 120, 212, 0.3);
}

/* 搜索容器 */
.search-container {
  position: relative;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  /* 确保不裁剪绝对定位的搜索建议 */
  overflow: visible;
}

/* 搜索建议 */
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  margin-top: 8px;
  max-height: 400px; /* 增加最大高度，允许显示更多内容 */
  min-height: auto; /* 自动调整最小高度 */
  height: auto; /* 高度自适应内容 */
  overflow-y: auto; /* 内容超过最大高度时显示滚动条 */
  z-index: 9999; /* 提高z-index，确保显示在最上层 */
  /* 从display: none改为visibility，以便支持平滑过渡动画 */
  visibility: hidden;
  opacity: 0;
  /* 初始状态：向上偏移10px，缩放Y轴0.8，从搜索框下方弹出的效果 */
  transform: translateY(-10px) scaleY(0.8);
  transform-origin: top center;
  /* 平滑过渡动画，使用弹性效果 */
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
  /* 确保内容区域不会被裁剪 */
  overflow-x: hidden;
  /* 确保定位正确 */
  backface-visibility: hidden;
  /* 确保内容完整显示 */
  padding: 0;
  margin: 8px 0 0 0;
}

.search-suggestions.show {
  /* 显示状态：完全可见，无偏移，正常缩放 */
  visibility: visible;
  opacity: 1;
  transform: translateY(0) scaleY(1);
  pointer-events: auto;
}

.suggestion-item {
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.search-suggestions.show .suggestion-item {
  opacity: 1;
  transform: translateY(0);
}

/* 为每个建议项添加递增的延迟，创建瀑布流效果 */
.search-suggestions.show .suggestion-item:nth-child(1) { transition-delay: 0.03s; }
.search-suggestions.show .suggestion-item:nth-child(2) { transition-delay: 0.06s; }
.search-suggestions.show .suggestion-item:nth-child(3) { transition-delay: 0.09s; }
.search-suggestions.show .suggestion-item:nth-child(4) { transition-delay: 0.12s; }
.search-suggestions.show .suggestion-item:nth-child(5) { transition-delay: 0.15s; }
.search-suggestions.show .suggestion-item:nth-child(6) { transition-delay: 0.18s; }
.search-suggestions.show .suggestion-item:nth-child(7) { transition-delay: 0.21s; }
.search-suggestions.show .suggestion-item:nth-child(8) { transition-delay: 0.24s; }
.search-suggestions.show .suggestion-item:nth-child(9) { transition-delay: 0.27s; }
.search-suggestions.show .suggestion-item:nth-child(10) { transition-delay: 0.3s; }

/* 搜索建议项 */
.suggestion-item {
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  color: #333;
  font-size: 14px;
  transform-origin: top;
}

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

.suggestion-item:hover {
  background: rgba(0, 120, 212, 0.1);
  color: #0078d4;
  transform: translateX(5px);
}

.suggestion-item:active {
  background: rgba(0, 120, 212, 0.2);
  transform: translateX(3px);
}

/* 键盘导航激活状态样式 */
.suggestion-item.active {
  background: rgba(0, 120, 212, 0.15);
  color: #0078d4;
  transform: translateX(5px);
  font-weight: 500;
  /* 添加高亮边框 */
  border-left: 3px solid #0078d4;
}

/* 滚动条样式 */
.search-suggestions::-webkit-scrollbar {
  width: 6px;
}

.search-suggestions::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

.search-suggestions::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.search-suggestions::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* 网站分类区域 */
.categories {
  display: flex;
  flex-direction: column;
  gap: 25px;
  margin-bottom: 40px;
  /* 确保分类板块不会遮挡搜索建议 */
  z-index: 0;
  position: relative;
}

.category {
  padding: 25px;
  /* 确保分类项不会遮挡搜索建议 */
  z-index: 5;
  position: relative;
}

.category-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 20px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.category-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #333;
}

.website-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.website-item {
  text-align: center;
  padding: 12px;
  border-radius: 10px;
  background: transparent;
  transition: all 0.3s ease;
  cursor: pointer;
  backdrop-filter: none;
  border: none;
}

.website-item:hover {
  transform: translateY(-3px);
  background: transparent;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.website-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.website-icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.website-item:hover .website-icon {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.website-name {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  background: transparent;
}

/* 返回顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  color: #333;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-5px) scale(1.1);
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.back-to-top:active {
  transform: translateY(-2px) scale(0.95);
}

.back-to-top svg {
  transition: all 0.3s ease;
}

.back-to-top:hover svg {
  transform: translateY(-2px);
}

/* 版权信息 */
.footer {
  width: 100%;
  text-align: center;
  padding: 20px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
  border-radius: 0;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0;
  z-index: 999;
}

/* 响应式设计 */
@media (max-width: 768px) {
  /* 主容器 */
  #app {
    padding-bottom: 50px; /* 增加底部预留空间，避免与固定footer重合 */
  }
  
  /* 顶部导航 */
  .top-nav {
    flex-direction: column;
    gap: 15px;
    padding: 15px 20px;
    text-align: center;
  }
  
  .nav-left {
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
  }
  
  .nav-right .main-title {
    font-size: 24px;
  }
  
  /* 标题区域 */
  .title-section {
    padding: 20px;
  }
  
  .time-display {
    font-size: 28px;
  }
  
  .date-display {
    font-size: 18px;
  }
  
  /* 快捷按钮 */
  .quick-buttons {
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 20px;
  }
  
  .quick-btn {
    padding: 10px 20px;
    font-size: 14px;
    flex: 1;
    min-width: 120px;
  }
  
  /* 搜索区域 */
  .search-section {
    padding: 0 20px;
    flex-direction: column;
    gap: 10px;
  }
  
  .search-box {
    width: 100%;
    font-size: 14px;
  }
  
  .search-btn {
    width: 100%;
    font-size: 14px;
  }
  
  /* 分类板块 */
  .categories {
    padding: 0 20px;
  }
  
  .category {
    padding: 20px;
  }
  
  .category-title {
    font-size: 18px;
  }
  
  .website-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
  }
  
  .website-item {
    padding: 10px;
  }
  
  .website-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
  
  .website-icon img {
    width: 24px;
    height: 24px;
  }
  
  .website-name {
    font-size: 13px;
  }
  
  /* 版权信息 */
  .footer {
    font-size: 13px;
    padding: 15px;
  }
}

@media (max-width: 480px) {
  /* 更小号设备优化 */
  .nav-right .main-title {
    font-size: 22px;
  }
  
  .time-display {
    font-size: 24px;
  }
  
  .date-display {
    font-size: 16px;
  }
  
  .quick-btn {
    min-width: 100px;
    padding: 8px 16px;
    font-size: 13px;
  }
  
  .website-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
