/* Reset styles (from reset.css) */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family:
  /* 优先使用现代美观字体（如果你已加载了 Inter 或其他） */
  "Inter", 

  /* 系统原生字体：兼容 Windows/macOS/iOS/Android */
  "Segoe UI", "Helvetica Neue", "Helvetica", "Arial",

  /* 中文系统字体 fallback（优先 PingFang） */
  "PingFang SC", "Noto Sans SC", "Microsoft YaHei",

  /* Linux 与低版本兼容字体 */
  "WenQuanYi Micro Hei", "sans-serif";
  background-color: #f5f5f5;
  font-size: 100%;
  display: flex;
  flex-direction: column;
}
html[lang="en"] body {
  letter-spacing: normal;
}
html[lang="zh"] body {
  letter-spacing: 0.05em;
}

/* 基本样式，确保容器和图像能正常显示 */

/* Container that holds both sidebar and main content */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}
.container-ml200px-buffer {
  margin-left: 200px;
  flex: 1;
}
/* Sidebar styling */
.sidebar {
  width: 200px; /* Fixed width for the sidebar */
  background-color: rgba(51, 51, 51, 0.8);
  color: white;
  padding: 1rem;
  backdrop-filter: blur(1px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: fixed;  /* Make the sidebar fixed */
  top: 0;           /* Stick it to the top */
  left: 0;          /* Align it to the left */
  height: 100dvh;     /* Full height */
  z-index: 10;      /* Ensure it's above other content */
  transition: left 0.3s ease;  /* Smooth transition when sliding in */
}

/* Sidebar links */
.sidebar > ul {
  list-style-type: none;
  padding: 0;
  margin-top: 2rem;  /* Add margin to top for better alignment */
}

.sidebar li {
  margin: 1rem 0;
  text-align: center;
  transition: transform 0.3s ease; /* Add smooth transition for movement */
}

.sidebar a {
  text-decoration: none;
  text-decoration-color: transparent;
  transition:
    background-color 0.3s,
    text-decoration-color 0.4s ease;
  color: white;
  display: block;
  padding: 0.5rem;
}

.sidebar a:hover {
  background-color: rgba(68, 68, 68, 0.8);
}

/* Hover effect to move the list items
.sidebar li:hover {
  transform: translateX(10px);
} */

/* 下拉菜单 */
.dropdown {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.4s ease, opacity 0.4s ease;
  opacity: 0;
  background-color: rgba(51, 51, 51, 0.8);
  list-style: none;
}

.dropdown li a {
  color: white;
  text-decoration: none;
  display: block;
}

.dropdown li a:hover {
  background-color: rgba(87, 87, 87, 0.8);
}

/* 展开时添加这个 class */
.dropdown.show {
  display: block;
  max-height: 500px; /* 够显示全部 li 就行，可以按项目数量设 */
  opacity: 1;
}

/* Sidebar Bottom Area*/
.sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
/* Header Logo Area*/
.sidebar-footer {
  text-align: center;
  margin-top: auto;
}
#sidebar-logo {
  width: 200px;
  height: auto;
  opacity: 0.7;
  transition: opacity 0.3s ease;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.3));
}
#sidebar-logo:hover {
  opacity: 1;
}

/* 当侧边栏打开时禁止主区域交互 */
body.sidebar-open main {
  pointer-events: none;
  user-select: none;
  filter: blur(2px);
}

/* 侧边栏 Site Theme Area*/
.site-theme {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.site-theme select {
  width: 100%;
  max-width: 85%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 修复下拉菜单字体（主题选择器） */
.site-theme select,
select.theme-selector {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
               Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
}

/* 语言选择器在底部并且居中 */
.lang-area {
  display: flex;
  flex-direction: column; /* 使label和select垂直排列 */
  align-items: center; /* 使内容水平居中 */
  justify-content: center; /* 使内容垂直居中 */
}
/* 修复语言区域字体，保持系统默认 */
.lang-area label,
.lang-area input[type="radio"] {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
               Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
}

/* Main content */
#page-content {
  flex: 1;
}
main {
  flex: 1;
  padding: 1rem;
  /*margin-left: 200px; /* Ensure main content doesn't overlap sidebar */
  transition: margin-left 0.3s; /* Smooth transition for margin */
  /*padding-bottom: 100px;  /* Add padding at the bottom to ensure footer doesn't overlap */
}
button {
  all: unset;
  appearance: none;
  -webkit-appearance: none;
  padding: 0.25rem 0.5rem;
  font-size: 0.9rem;
  border: 1px solid #666;
  border-radius: 4px;
  background-color: #f4f4f4;
  cursor: pointer;
}
button:hover {
  background-color: #e0e0e0;
}
/* Footer styling */
footer {
  text-align: center;
  font-size: 0.7rem;
  bottom: 0;
  left: 0;
  width: 100%;
  margin-top: auto;
  z-index: 1;
  backdrop-filter: blur(1px);
}
.footer-content {
  text-align: center;
  font-size: 0.9rem;
  margin-left: 200px;
  padding: 1em 0;
  background-color: rgba(221, 221, 221, 0.8);
  color: #333;
}
.footer-content .disclaimer {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
               Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
  font-size: 0.75rem;
  line-height: 1.5;
  margin: 0 auto 0 auto;
  max-width: 720px;
  text-align: center;
  font-style: italic;
  text-transform: none !important;
  color: #555;
}
html[lang="en"] .footer-content .disclaimer {
  font-style: italic;
}
html[lang="zh"] .footer-content .disclaimer {
  font-style: normal;
}

.footer-contact-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  text-align: center;
}
.footer-contact a {
  color: inherit;
  text-decoration: none;
}
.footer-contact a:hover {
  text-decoration: underline;
}
.social-links a {
  text-decoration: none;
}
.social-links img {
  width: 24px;
  margin: 0 4px;
  opacity: 0.3;
  vertical-align: middle;
}
.footer-content:not([class*="theme-"]) .disclaimer { color: #444; }

/* 移动端响应 */
.menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 98;
  background: #333;
  color: white;
  border: none;
  font-size: 1.5rem;
  padding: 0.5rem;
  cursor: pointer;
}
.menu-toggle:hover {
  background-color: #555;
}
/* 在移动端优化显示 */
@media (max-width: 768px) {
  .container-ml200px-buffer {
  margin-left: 0;
  }
  .container {
  margin-top: 3rem;
  width: 100%;
  padding: 0 1rem;
  box-sizing: border-box;
  }
  .sidebar {
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  position: fixed;
  top: 0;
  left: 0;
  width: 70vw;
  max-height: 100dvh;
  background-color: rgba(51, 51, 51, 0.8);
  z-index: 97;
  }

  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-footer {
    display: none;
  }
  #sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(4px);
    background-color: rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 80;
  }
  #sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
  }
  .menu-toggle {
    display: block;
  }
  main {
    margin-left: 0;
  }
  .footer-content {
    margin-left: 0;
  }

}

@media (max-height: 500px) and (orientation: landscape) {
  .sidebar {
    overflow-y: auto;
    max-height: 100dvh;
    -webkit-overflow-scrolling: touch; /* 平滑滚动 */
    overscroll-behavior: contain;      /* 防止滚动穿透 */
  }

  .sidebar nav {
    padding-bottom: 2rem; /* 避免底部内容贴边被遮 */
  }
}
