/* 全局平滑滚动 */
* {
  scroll-behavior: smooth;
}

/* ---------------------------------- */
/* -- 主导航容器 (侧边栏) -- */
/* ---------------------------------- */

.pagenav {
  position: fixed;
  top: 25vh;                 /* 距顶部固定距离 */
  align-self: flex-start;    /* 保证在父容器内自适应高度 */
  width: 15%;
  font-weight: 800;
  margin-left: 1%;
  max-width: 40%;
  min-width: 30%;
  margin-right: max(25px, 2vw);
  padding: 4% 20px 30px 30px;
  line-height: 0.25;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transform: translateX(-10%);
  max-height: calc(100vh - 100px); /* 防止超过视窗高度 */
  overflow-y: auto;               /* 内容过多时可滚动，不会压到 footer */
}

/* 优化滚动条样式（仅针对 WebKit 浏览器） */
.pagenav::-webkit-scrollbar {
  width: 6px;
}


/* ---------------------------------- */
/* -- 一级导航项容器 (div) -- */
/* ---------------------------------- */
.pagenav > div {
  text-align: center;
  cursor: pointer;
  height: auto;
  overflow: visible;
  word-break: break-word;   /* 允许长标题换行 */
  white-space: normal;      /* 防止长标题被强制在一行 */
  padding: 6px 0;
}

/* 悬停效果 */
.pagenav > div:hover {
  height: auto;
}

/* 用于垂直居中文字的伪元素 */
.pagenav > div::before {
  content: '';
  width: 0;
  height: 100%;
  display: inline-block;
  position: relative;
  vertical-align: middle;
}

/* ---------------------------------- */
/* -- 一级导航项文字 (span) -- */
/* ---------------------------------- */
.pagenav > div > span {
  font-family: Arlon, sans-serif;
  color: #b57637;
  font-size: min(1.2vw, 20px);
  letter-spacing: 2px;
  vertical-align: middle;
  transition: all 0.2s ease-out;
  cursor: pointer;
  display: inline-block;
  padding: 10px 8px;
  line-height: 1.4;
  word-break: break-word;   /* 长标题自动换行 */
  white-space: normal;
  text-align: center;
  max-width: 100%;
}

/* 悬停放大效果 */
.pagenav > div > span:hover {
  font-size: min(1.3vw, 22px);
  transition: all 0.1s linear;
}

/* 当前高亮项 */
.pagenav > div.active > span {
  color: rgb(255, 140, 0);
  font-weight: bold;
}
