body, html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

@media screen and (max-width: 768px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* 导航栏样式 */
.menu-custom {
  background-color: rgba(0, 0, 0, 0.3) !important;
  border: none;
  padding: 10px 0;
  width: 100vw;
  margin: 0;
  position: fixed;
  top: 0;
  left: 0;
}

.menu-custom .item {
  color: #ffffff !important;
  font-size: 16px;
  font-weight: 500;
  padding: 10px 15px;
  transition: color 0.3s ease, background-color 0.3s ease;
}

.menu-custom .right.menu {
  margin-right: 50px;
}

.menu-custom .header.item {
  font-size: 20px;
  font-weight: bold;
  color: #ffffff !important;
}

.menu-custom .logo-image {
  width: 30px;
  height: 30px;
  margin-right: 10px;
}

.menu-custom .logo-text {
  color: #ffffff !important;
}

/* 侧边栏样式 */
.sidebar {
  background-color: rgba(255, 255, 255, 0.95) !important;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar .item {
  color: #000000 !important;
}

.sidebar-header {
  background-color: rgba(0, 0, 0, 0.9) !important;
}

.sidebar-header .logo-text {
  color: #ffffff !important;
}

.sidebar-header .close-btn i {
  color: #ffffff !important;
}

/* 现代感搜索框 */
.modern-search-box {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  transform-style: preserve-3d;
  perspective: 1000px;
  z-index: 1001;
}

/* 搜索框表单 */
.modern-search-box form {
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  padding: 8px 16px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  will-change: border-radius, box-shadow;
  position: relative;
  z-index: 1000;
  transition: box-shadow 0.18s ease-out;
}

.modern-search-box input {
  border: none;
  outline: none;
  flex: 1;
  padding: 8px;
  font-size: 14px;
  background: transparent;
}

.modern-search-box button {
  border: none;
  background: transparent;
  cursor: pointer;
}

.modern-search-box button i {
  font-size: 18px;
  color: #4285F4;
}

/* 搜索引擎按钮 */
.search-engine-buttons {
  display: flex;
  align-items: center;
  margin-right: 10px;
  position: relative;
}

.search-engine-buttons button {
  background-color: transparent;
  color: black;
  border: none;
  border-radius: 50%;
  padding: 5px;
  margin: 0 5px;
  cursor: pointer;
}

.search-engine-buttons .icon {
  font-size: 18px;
}

/* 搜索引擎选择区域 */
.search-engines {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 0 0 20px 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  z-index: 999;
  margin: 0 auto;
  max-width: 100%;
  transform-origin: top center;
  transform: scaleY(0);
  opacity: 0;
  height: 0;
  overflow: hidden;
  will-change: transform, opacity, height;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1),
              height 0s linear 0.28s;
}

/* 面板展开时的样式 */
.search-engines.visible {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 15px;
  transform: scaleY(1);
  opacity: 1;
  height: auto;
  pointer-events: all;
  transition: transform 0.38s cubic-bezier(0.17, 0.67, 0.21, 1.06),
              opacity 0.32s cubic-bezier(0.17, 0.67, 0.21, 1.06),
              height 0s linear;
}

/* 搜索框与面板的连接效果 */
.modern-search-box.engines-visible form {
  border-radius: 20px 20px 0 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.modern-search-box.engines-visible .search-engines {
  border-top: none;
}

/* 搜索引擎按钮样式 */
.search-engines button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin: 5px;
  border-radius: 50%;
  opacity: 0;
  transform: translateY(10px);
  transition: background-color 0.2s ease,
              transform 0.2s ease,
              opacity 0.1s ease;
}

.search-engines.visible button {
  opacity: 1;
  transform: translateY(0);
  transition: background-color 0.2s ease,
              transform 0.3s cubic-bezier(0.17, 0.67, 0.21, 1.06),
              opacity 0.3s cubic-bezier(0.17, 0.67, 0.21, 1.06);
}

/* 按钮按顺序出现的动画 */
.search-engines button:nth-child(1) { transition-delay: 0.05s; }
.search-engines button:nth-child(2) { transition-delay: 0.08s; }
.search-engines button:nth-child(3) { transition-delay: 0.11s; }
.search-engines button:nth-child(4) { transition-delay: 0.14s; }
.search-engines button:nth-child(5) { transition-delay: 0.17s; }
.search-engines button:nth-child(6) { transition-delay: 0.20s; }
.search-engines button:nth-child(7) { transition-delay: 0.23s; }
.search-engines button:nth-child(8) { transition-delay: 0.26s; }

.search-engines button:hover {
  background-color: rgba(0, 0, 0, 0.05);
  transform: scale(1.1);
}

.search-engines button:active {
  transform: scale(0.9);
}

/* 搜索引擎图标 */
.search-engines .icon {
  font-size: 20px;
  color: #333;
}

/* 搜索快捷方式 */
#search-shortcuts {
  margin-top: 120px; /* 增加顶部边距，为搜索候选框留出足够空间 */
  display: flex;
  justify-content: center;
  will-change: transform, opacity;
  transition: transform 0.4s cubic-bezier(0.17, 0.67, 0.21, 1.06),
              opacity 0.4s cubic-bezier(0.17, 0.67, 0.21, 1.06);
  position: relative;
  z-index: 5;
}

/* 搜索按钮 */
.search-button {
  border: none;
  background-color: #4285F4;
  color: rgb(0, 0, 0);
  padding: 8px 16px;
  border-radius: 24px;
  cursor: pointer;
  font-size: 14px;
}

/* 搜索框整体下移 */
.text-container-custom {
  margin-top: 150px;
}

/* 超链接区域排版 */
.links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  justify-content: center;
}

.links-column {
  flex: 1 1 calc(25% - 1px);
  box-sizing: border-box;
  min-width: 200px;
  background-color: #ffffff;
  border-right: 1px solid #e0e0e0;
}

@media (max-width: 1200px) {
  .links-column {
    flex: 1 1 calc(33.33% - 1px);
  }
}

@media (max-width: 992px) {
  .links-column {
    flex: 1 1 calc(50% - 1px);
  }
}

@media (max-width: 768px) {
  .links-column {
    flex: 1 1 100%;
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
  }
  .ui.large.borderless.inverted.menu.menu-custom {
    height: auto;
    padding: 10px 0;
    font-size: 16px;
  }
  .ui.stackable.grid > .three.wide.column {
    width: 30% !important;
  }
  .ui.stackable.grid > .seven.wide.column {
    width: 100% !important;
  }
  .search-suggestions-dropdown {
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
  }
  .menu-custom {
    padding: 5px 0;
  }
  .menu-custom .item {
    padding: 10px;
  }
  .menu-custom .header.item {
    font-size: 18px;
  }
  .menu-custom .logo-image {
    width: 25px;
    height: 25px;
  }
  .mobile-nav-toggle {
    display: block;
  }
  .menu-custom.mobile {
    display: none;
  }
  
  /* 移动端搜索引擎下拉菜单样式被移除，使用全局样式 */
  
  /* 所有搜索引擎样式已移至全局，此处不需要重复定义 */
  
  /* 移动端搜索引擎选择框自适应优化 */
  .modern-search-box {
    width: 90%;
    margin: 0 auto;
  }
  
  .search-engines, .search-engines.visible {
    transition-duration: 0.32s;
  }
  
  .search-engines button:nth-child(n) {
    transition-delay: 0.05s;
  }
  
  .search-engines button:nth-child(n+4) {
    transition-delay: 0.08s;
  }
}

/* 标题灰色背景 */
.ui.top.attached.label {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
  padding: 12px;
  font-size: 16px;
  font-weight: bold;
  color: #333333;
}

/* 栏目内容区域 */
.links-column .ui.link.labels {
  padding: 15px;
  background-color: #ffffff;
}

/* 超链接标签样式 */
.ui.link.labels {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ui.link.labels a {
  flex: 1 1 calc(20% - 5px);
  margin: 2px;
  white-space: nowrap;
  color: #000000;
  text-decoration: none;
  transition: color 0.3s ease;
  text-align: center;
}

.ui.link.labels a:hover {
  color: #1a73e8;
}

.ui.inverted.vertical.footer.segment {
  padding-top: 70px;
  padding-bottom: 50px;
}

/* 导航栏整体变大 */
.ui.large.borderless.inverted.menu.menu-custom {
  height: 80px;
  padding: 20px 0;
  font-size: 18px;
}

/* 汉堡菜单按钮 */
.mobile-nav-toggle {
  display: none;
  cursor: pointer;
  padding: 10px;
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1000;
}

.mobile-nav-toggle i {
  font-size: 24px;
  color: white;
}

/* 侧边栏 */
.sidebar {
  position: fixed;
  top: 0;
  left: -180px;
  width: 180px;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.9);
  transition: left 0.3s ease;
  z-index: 1001;
}

.sidebar.active {
  left: 0;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.sidebar-overlay.active {
  display: block;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background-color: rgba(0, 0, 0, 0.8);
}

.sidebar-header .logo-text {
  font-size: 18px;
  color: white;
}

.sidebar-header .close-btn {
  cursor: pointer;
}

.sidebar-header .close-btn i {
  font-size: 24px;
  color: white;
}

.sidebar-menu {
  padding: 20px;
}

.sidebar-menu .item {
  display: block;
  padding: 10px 0;
  color: white;
  text-decoration: none;
}

.sidebar-menu .item:hover {
  color: #1a73e8;
}

video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* 背景容器 */
.background-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* 内容容器 */
.ui.inverted.vertical.masthead.center.aligned.segment.zoomed {
  position: relative;
  z-index: 1;
  background: transparent; /* 确保背景透明 */
}

/* 导航栏隐藏时的样式 */
.ui.large.borderless.inverted.menu.menu-custom {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.ui.large.borderless.inverted.menu.menu-custom.hidden {
  opacity: 0;
  transform: translateY(-100%);
}

/* 搜索提示样式 */
datalist {
  position: absolute;
  background-color: rgba(255, 255, 255, 0.9); /* 半透明背景 */
  border: 1px solid rgba(0, 0, 0, 0.1); /* 浅色边框 */
  border-radius: 8px; /* 圆角 */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* 阴影 */
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  width: 100%; /* 与搜索框同宽 */
  top: 100%; /* 放置在搜索框下方 */
  left: 0;
  width: calc(100% - 32px); /* 减去 padding */
  margin-top: 5px;
  backdrop-filter: blur(10px); /* 毛玻璃效果 */
}

datalist option {
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  color: #333; /* 文字颜色 */
}

datalist option:hover {
  background-color: rgba(0, 0, 0, 0.05); /* 悬停时的背景色 */
}

/* 搜索下拉建议框样式 */
.search-suggestions-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  margin-top: 10px;
  z-index: 1002; /* 确保高于所有其他元素 */
  padding: 8px 0;
}

.search-suggestions-dropdown::-webkit-scrollbar {
  width: 6px;
}

.search-suggestions-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

.search-suggestions-dropdown::-webkit-scrollbar-thumb {
  background-color: transparent;
  border-radius: 3px;
}

/* 仅在滚动时显示滚动条 */
.search-suggestions-dropdown:hover::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
}

.suggestion-item {
  padding: 10px 16px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  border-radius: 15px;
  margin: 0 8px;
}

.suggestion-item:hover, .suggestion-item.selected {
  background-color: rgba(66, 133, 244, 0.1);
  color: #4285F4;
}

/* 当鼠标悬停在已经选中的项目上时，增强视觉效果 */
.suggestion-item.selected:hover {
  background-color: rgba(66, 133, 244, 0.2);
}

/* 当搜索候选框显示时，调整search-shortcuts的位置 */
.search-suggestions-dropdown + #search-shortcuts,
.search-suggestions-dropdown ~ #search-shortcuts {
  margin-top: calc(300px + 30px); /* 候选框高度 + 额外间距 */
}

/* 当搜索候选框可见时，调整搜索快捷方式的位置 */
.search-suggestions-visible #search-shortcuts {
  margin-top: 330px; /* 给搜索候选框留出足够空间 */
}

/* 调整搜索快捷方式的位置，确保不会与下拉菜单重叠 */
@media (min-width: 769px) {
  .search-suggestions-dropdown {
    position: absolute;
    /* 其他属性保持不变 */
  }
  
  /* 主页内容向下移动 */
  .text-container-custom {
    margin-top: 200px; /* 增加顶部边距，为搜索候选框留出空间 */
  }
}

@media (max-width: 768px) {
  .search-suggestions-dropdown {
    position: absolute;
    /* 其他属性保持不变 */
  }
  
  /* 主页内容向下移动 */
  .text-container-custom {
    margin-top: 180px; /* 移动端略微调整 */
  }
}

/* 使搜索引擎选择器显示在search-shortcuts位置但不隐藏它 */
.modern-search-box.engines-visible + #search-shortcuts {
  opacity: 1;
  transform: translateY(70px);
  transition: transform 0.4s cubic-bezier(0.17, 0.67, 0.21, 1.06) 0.1s;
}