html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: auto;
  box-sizing: border-box;
  font-family: 'Georgia', 'Times New Roman', Times, serif;
}
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
  margin: 0;
}
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
}
.header .site-name a,
.header .title a {
  padding-left: 80px !important;
  margin-left: 0px !important;
  font-size: 1.1em;
  color: var(--text-color);
}
.header .menus a,
.header .nav a {
  font-size: 0.85em;
  margin-left: 15px;
  color: var(--text-color);
}
.main {
  flex-grow: 1;
  overflow: visible;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 0px;
  min-height: 0;
}
.profile-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 50px;
  padding-bottom: 5px;
  max-width: 100%;
  box-sizing: border-box;
}
.profile-container .avatar img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 2px;
}
.profile-container .nickname {
  font-size: 1.8em;
  margin-bottom: 1px;
}
.profile-container .description {
  font-size: 0.8em;
  margin-bottom: 0px;
}
.links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  position: relative;
}
.link-item-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 25px;
  width: 25px;
  cursor: pointer;
}
.link-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--link-color);
  text-decoration: none;
  transition: transform 0.2s ease-in-out;
  font-size: 1em;
}
.link-item:hover {
  transform: translateY(-2px);
}
.qr-code-popup {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--card-bg-color);
  padding: 6px;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  min-width: 110px;
  text-align: center;
  margin-top: 5px;
}
.qr-code-popup img {
  width: 100px;
  height: 100px;
  display: block;
  margin: 0 auto;
  border-radius: 4px;
}
/* 鼠标悬停在 .link-item-wrapper 上时显示二维码 */
.link-item-wrapper:hover .qr-code-popup {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.footer {
  padding-top: 120px;
  padding-bottom: 60px;
  margin: 0px;
  position: relative;
  width: 100%;
  flex-shrink: 0;
  text-align: center;
}
.footer .copyright {
  font-size: 0.9em;
  padding: 0;
  margin: 0;
}
@media screen and (max-width: 1279px) {
  .post-toc {
    display: block !important;
  }
  .container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0 10px;
    box-sizing: border-box;
  }
  article.post-wrap {
    width: calc(100% - 220px);
    flex-shrink: 1;
    min-width: 300px;
    padding: 15px;
    box-sizing: border-box;
  }
}
@media screen and (max-width: 768px) {
  body {
    padding-top: 85px; /* 将此值设置为导航栏实际高度 80.6641px 加上一点安全边距 */
    box-sizing: border-box;
  }
  .container {
    flex-direction: column;
    align-items: center;
    padding: 0 15px;
    box-sizing: border-box;
    width: 100%;
  }
  .post-toc {
    display: block !important;
    position: relative !important;
    float: none;
    width: 90%;
    margin-left: 0;
    margin-top: 20px;
    order: 2;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 0.85rem !important;
  }
  article.post-wrap {
    width: 90%;
    float: none;
    margin-top: 20px;
    order: 1;
  }
  .header {
    padding: 10px 15px;
    position: fixed;
    top: 0 !important;
    left: 0;
    width: 100%;
    height: auto !important;
    min-height: 85px;
    background-color: var(--card-bg-color); /* 添加背景色以防止内容透过 */
    z-index: 1000; /* 确保在其他内容之上 */
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .site-name a,
  .title a {
    padding-left: 0 !important;
    margin-left: 0 !important;
    font-size: 1em;
  }
  .navbar-header {
    margin-top: 0 !important;
    padding-top: 0 !important;
    display: flex; /* 确保内部元素如 site-name 和 menu-toggle 能正确对齐 */
    align-items: center;
    justify-content: space-between; /* LSH's Blog 和汉堡菜单左右对齐 */
    width: 100%; /* 确保它占据可用宽度 */
  }
  .header .container {
    padding-top: 0 !important;
    margin-top: 0 !important;
  }
  .menus,
  .nav {
    display: none;
  }
  .profile-container {
    padding-top: 20px;
    padding-bottom: 5px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
  }
  .main {
    padding-top: 0;
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
    width: 100%;
  }
  .footer {
    padding-top: 50px;
    padding-bottom: 40px;
  }
  .profile-container .nickname {
    font-size: 1.5em;
  }
  .profile-container .description {
    font-size: 0.75em;
  }
  .links {
    gap: 8px;
  }
  .materials-container {
    max-width: 100%;
    padding: 15px;
    margin: 0 auto 20px auto;
    box-sizing: border-box;
  }
  .materials-nav {
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 15px;
    width: 100%;
    margin: 0 auto 15px auto;
  }
  .materials-nav-item {
    padding: 8px 15px;
    margin: 5px;
  }
  .materials-search input[type="text"] {
    width: 95%;
    padding: 8px 12px;
  }
  .file-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 0;
  }
  .file-name {
    margin-bottom: 5px;
    text-align: left;
    width: 100%;
  }
  .file-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .file-actions a {
    padding: 4px 8px;
    font-size: 0.9em;
  }
  .file-actions a.preview-btn {
    margin-right: 8px;
  }
  .pdf-preview-content {
    width: 95%;
    height: 95%;
  }
  .pdf-preview-header {
    padding: 8px;
  }
  .pdf-preview-title {
    font-size: 1em;
  }
  .close-button {
    font-size: 24px;
  }
  .footer .copyright {
    font-size: 0.8em;
  }
  .footer {
    padding-bottom: 20px;
  }
}
.post-toc {
  position: fixed !important;
  top: 96px !important;
  right: 2em !important;
  width: 15rem !important;
  font-size: 0.75rem !important;
  display: block !important;
  z-index: 100;
}
/* 小网盘功能自定义CSS样式 - 桌面端通用部分 */
.materials-container {
  max-width: 900px;
  width: 100%;
  margin: 0 auto 30px auto; /* 居中，并保持底部外边距 */
  padding: 20px;
  background-color: var(--card-bg-color);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
/* 资料页面搜索框样式 */
.materials-search {
  margin-bottom: 20px;
  text-align: center;
}
.materials-search input[type="text"] {
  width: 80%;
  max-width: 400px;
  padding: 10px 15px;
  border: 1px solid var(--border-color);
  border-radius: 25px;
  font-size: 1em;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.materials-search input[type="text"]:focus {
  border-color: var(--link-color);
  box-shadow: 0 0 5px var(--link-color-rgb) 0.3;
}
.materials-nav {
  display: flex;
  justify-content: center /* 居中对齐导航项 */;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
  flex-wrap: nowrap;
  min-width: 350px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.materials-nav-item {
  padding: 10px 20px;
  cursor: pointer;
  font-weight: bold;
  color: var(--text-color);
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
  white-space: nowrap;
}
.materials-nav-item:hover {
  color: var(--link-color);
}
.materials-nav-item.active {
  color: var(--link-color);
  border-bottom-color: var(--link-color);
}
.materials-content {
  padding-top: 10px;
}
.material-type {
  display: none /* 默认隐藏所有内容面板 */;
}
.material-type.active {
  display: block /* 激活的面板显示 */;
}
.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-color);
}
.file-item:last-child {
  border-bottom: none;
}
.file-name {
  flex-grow: 1;
  font-size: 1.1em;
  color: var(--text-color);
}
.file-actions {
  display: flex;
  align-items: center;
}
.file-actions a {
  display: inline-block;
  padding: 5px 10px;
  background-color: var(--link-color);
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  transition: all 0.3s ease /* 保持平滑过渡 */;
}
.file-actions a:hover {
  filter: brightness(90%) /* 使用 filter 降低亮度 */;
}
.file-actions a.preview-btn {
  background-color: var(--second-color);
  margin-left: 0;
  margin-right: 10px;
}
.file-actions a.preview-btn:hover {
  filter: brightness(90%) /* 使用 filter 降低亮度 */;
}
.pdf-preview-modal {
  display: none /* 默认隐藏 */;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
}
.pdf-preview-content {
  background-color: #fefefe;
  margin: auto;
  padding: 0;
  border: 1px solid #888;
  width: 90%;
  height: 90%;
  position: relative;
  display: flex;
  flex-direction: column;
}
.pdf-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background-color: #f0f0f0;
  border-bottom: 1px solid #ddd;
}
.pdf-preview-title {
  font-weight: bold;
}
.close-button {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}
.close-button:hover,
.close-button:focus {
  color: #000;
  text-decoration: none;
}
.pdf-iframe-container {
  flex-grow: 1;
  width: 100%;
  height: 100%;
}
.pdf-iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}
/* 分页样式 */
.pagination {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}
.page-button {
  background-color: var(--card-bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 8px 15px;
  margin: 0 5px;
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.3s ease;
}
.page-button:hover {
  background-color: var(--link-color);
  color: #fff;
}
.page-button.active {
  background-color: var(--link-color);
  color: #fff;
  border-color: var(--link-color);
}
