/* Custom styles for HeoLink static site */

/* 颜色变量 - 浅色模式(默认) */
:root {
  --bg-color: #f2f2f2;
  --content-bg: #ffffff;
  --text-color: #333333;
  --text-color-secondary: #666666;
  --border-color: #dddddd;
  --card-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  --card-hover-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  --nav-hover-bg: #f0f0f0;
}

/* 深色模式变量 */
[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --content-bg: #2d2d2d;
  --text-color: #e0e0e0;
  --text-color-secondary: #aaaaaa;
  --border-color: #444444;
  --card-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  --card-hover-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  --nav-hover-bg: #3a3a3a;
}

/* Overall layout */
body {
  background-color: var(--bg-color);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s ease;
}

.heolink_site {
  display: flex;
  min-height: 100vh;
}

#web_content {
  flex: 1;
  padding: 10px;
  background: var(--content-bg);
  margin-left: 221px;
  transition: background-color 0.3s ease;
}

/* 头像悬停旋转 */
.left_nav_logo_button_clickable img.avatar {
  border-radius: 50%; /* 圆形头像 */
  transition: transform 0.5s ease; /* 更平滑的过渡效果 */
}

.left_nav_logo_button_clickable img.avatar:hover {
  transform: rotate(360deg); /* 悬停时旋转360度 */
}

.linkPage_content {
  max-width: 1700px;
  margin: 0 auto;
  padding: 10px;
}

/* Cover image and title */
.site_info_group {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 30px;
  text-align: center;
  height: 230px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.site_info_group_back_cover {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  box-shadow: var(0 8px 16px -4px #2c2d300c);
}

.site_info_text {
  position: relative;
  z-index: 2;
  color: white;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.site_info_group_title {
  font-size: 35px;
  font-weight: bold;
  margin-bottom: 10px;
}

.site_info_group_desc {
  font-size: 20px;
  opacity: 0.9;
}

/* Search widget */
.search_widget {
  margin-bottom: 30px;
}

.search_widget_container {
  display: flex;
  position: relative;
  margin: 0 auto;
  max-width: 1000px;
}

.search_widget_container i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-color-secondary);
  transition: color 0.3s ease;
}

.search_widget_input {
  width: 100%;
  padding: 12px 15px 12px 45px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  box-shadow: var(--card-shadow);
  outline: none;
  background-color: var(--content-bg);
  color: var(--text-color);
  transition: all 0.3s ease;
}

.search_widget_input:focus {
  box-shadow: var(--card-hover-shadow);
}

/* Link groups */
.link_group {
  margin-bottom: 30px;
}

.link_group_title_content {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.link_group_title_content i {
  margin-right: 12px;
  font-size: 22px;
  color: var(--text-color);
}

.link_group_title {
  font-size: 20px;
  font-weight: bold;
  margin: 0;
  color: var(--text-color);
}

.link_group_content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 10px;
}

.link_group_content_link {
  text-decoration: none;
  color: inherit;
}

.link_group_content_item {
  background: var(--content-bg);
  border-radius: 10px;
  padding: 15px;
  display: flex;
  align-items: center;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
}

.link_group_content_item:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-hover-shadow);
}

.link_group_content_item_logo {
  width: 45px;
  height: 45px;
  margin-right: 15px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.link_group_content_item_logo_img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease; /* 添加平滑过渡效果 */
}

/* 添加图标旋转效果 */
.link_group_content_item:hover .link_group_content_item_logo_img {
  transform: rotate(360deg); /* 悬停时旋转360度 */
}

.link_group_content_item_info_content_title {
  font-weight: bold;
  margin: 0 0 5px 0;
  color: var(--text-color);
}

.link_group_content_item_info_content_description {
  margin: 0;
  font-size: 14px;
  color: var(--text-color-secondary);
}

/* Navigation */
.left_nav {
  width: 220px;
  background: var(--content-bg);
  box-shadow: 1px 0 0 var(--border-color);
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
  transition: background-color 0.3s ease;
}

.left_nav_logo {
  padding: 0 20px;
  margin-bottom: 10px;
}

.left_nav_logo_button {
  text-align: center;
}

.left_nav_logo_button_clickable img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: none; /* Prevent animation during resize */
  max-width: 60px; /* Limit max size */
}

.left_nav_link_group_list {
  flex: 1;
  overflow: auto;
}

#left_nav_group {
  min-width: 20px;
  max-width: 130px;
  padding: 0 50px;
  width: 100%;
}

.left_nav_link_group_item {
  margin-bottom: 10px;
}

.left_nav_link_group_title {
  display: flex;
  align-items: center;
  padding: 5px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.left_nav_link_group_title:hover {
  background-color: var(--nav-hover-bg);
  padding-left: 15px;
  padding-right: 15px;
}

.left_nav_link_group_title i {
  margin-right: 10px;
  color: var(--text-color);
}

.left_nav_link_group_title_name {
  font-size: 16px;
  color: var(--text-color);
}

.left_nav_menu_button_container {
  display: none;
}

.hide_item_when_mobile {
  display: none;
}

/* Footer */
.heolink_footer {
  text-align: center;
  margin-top: 40px;
  padding: 20px 0;
  color: var(--text-color-secondary);
  font-size: 14px;
}

/* 深色模式切换按钮 */
.theme-switch {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--content-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  transition: all 0.3s ease;
}

.theme-switch:hover {
  transform: rotate(30deg);
}

.theme-switch i {
  font-size: 20px;
  color: var(--text-color);
}

/* Responsive styles */
@media screen and (max-width: 768px) {
  .heolink_site {
    flex-direction: column;
  }
  
  /* Mobile header */
  .mobile_header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: var(--content-bg);
    box-shadow: 0 5px 6px -5px rgba(133, 133, 133, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 99;
    transition: background-color 0.3s ease;
  }

  /* Only render sidebar when needed */
  .left_nav {
    display: none;
  }

  /* Only show sidebar when active */
  .left_nav.active {
  display: block;
  width: 280px;
  height: 100vh;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  background: var(--content-bg);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  padding: 20px 0;
  overflow-y: auto;
  z-index: 1001;
  animation: slideIn 0.3s ease forwards;
}
  
  @keyframes slideIn {
    from {
      transform: translateX(100%);
    }
    to {
      transform: translateX(0);
    }
  }

  .left_nav_logo {
    display: none; /* Hide the logo in the sidebar since it's in the header */
  }
  
  .mobile_logo {
    display: flex;
    align-items: center;
  }
  
  .mobile_logo img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
  }
  
  .mobile_site_title {
    margin-left: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    transition: color 0.3s ease;
  }
  
  .mobile_menu_title {
    text-align: center;
    padding: 16px 0;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: color 0.3s ease;
  }

  #web_content {
    margin-left: 0;
    margin-top: 70px; /* Leave space for fixed header */
    padding-top: 10px;
  }
  
  .left_nav_link_group_list {
    display: block;
    padding: 0 20px;
  }
  
  .left_nav_menu_button_container {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .left_nav_menu_button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(127, 127, 127, 0.1);
  padding: 0;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.left_nav_menu_button:hover {
  background: rgba(127, 127, 127, 0.2);
}
  
  .left_nav_menu_button i {
    font-size: 20px;
    color: var(--text-color);
    line-height: 1;
    transition: color 0.3s ease;
  }
  
  .hide_item_when_mobile {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.3s ease;
  cursor: pointer;
}
  
  .hide_item_when_mobile.active {
    display: block;
    opacity: 1;
  }
  
  /* Mobile menu close button */
  .mobile_menu_close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(127, 127, 127, 0.1);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.mobile_menu_close:hover {
  background: rgba(127, 127, 127, 0.2);
}
  
  .mobile_menu_close i {
  font-size: 18px;
  color: var(--text-color-secondary);
  transition: color 0.3s ease;
}

  /* Nav item styles */
  .left_nav_link_group_item {
    margin-bottom: 2px;
    opacity: 0;
    transform: translateX(10px);
    animation: menuItemFadeIn 0.5s forwards;
    animation-delay: calc(0.05s * var(--item-index, 0));
  }
  
  .left_nav_link_group_title {
  padding: 10px 16px;
  border-radius: 8px;
  background-color: rgba(0, 0, 0, 0.02);
  margin-bottom: 4px;
  transition: background-color 0.3s ease;
}
  
  @keyframes menuItemFadeIn {
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  /* 移动端深色模式切换按钮位置调整 */
  .theme-switch {
    bottom: 70px;
  }
}

/* Fix for mobile-to-desktop transition */
@media screen and (min-width: 769px) {
  .mobile_header {
    display: none !important; /* Force hide */
  }
  
  /* Ensure mobile elements are properly hidden */
  .mobile_logo, 
  .mobile_site_title,
  .mobile_menu_title,
  .mobile_menu_close {
    display: none !important; /* Force hide */
  }
  
  /* Make sure desktop nav is always visible on large screens */
  .left_nav {
    display: flex !important;
  }
  
  /* Ensure proper logo size in desktop view */
  .left_nav_logo_button_clickable img {
    width: 60px !important;
    height: 60px !important;
    max-width: 60px !important;
    max-height: 60px !important;
  }
}

/* For animated transitions */
.link_group_content_link,
.left_nav_link_group_title,
.search_widget_input {
  transition: all 0.3s ease;
} 