@import url('variables.css');

/* ============================================
 * 全局基础样式
 * ============================================ */

body {
  color: var(--color-text-suitable);
  font-family: "Inter", "system-ui", "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
  font-size: 87.5%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: 40px;
}

a {
  color: var(--color-secondary);
  text-decoration: none;
}

a:hover, a:active {
  color: var(--color-link);
}

pre, code {
  font-family: Menlo, Monaco, Consolas, "Lucida Console", "Courier New", monospace;
  font-size: .92857em;
  
}

code {
  padding: var(--spacing-xs) var(--spacing-sm);
  /*color: var(--color-bg-dark);*/
}

pre {
  padding: var(--spacing-sm);
  overflow: auto;
  max-height: 400px;
}

pre code {
  padding: var(--spacing-xs);
}
pre.line-numbers {
background: var(--color-bg-suitable);
 color: var(--color-text-white);
}

table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  border: 1px solid var(--color-border-primary);
}
/* 针对表格单元格内的链接 */
td a, th a {
  color: #5076FE; /* 更柔和的蓝色 */
  text-decoration: none; /* 去除下划线，更现代 */
}

/* 悬停效果 */
td a:hover, th a:hover {
  color: #4D6BFE;
  text-decoration: underline;
}
table th, table td {
  padding: var(--spacing-sm) var(--spacing-md);
}

table th {
  background: var(--color-bg-secondary);
  text-align: left;
  color: var(--color-primary);
}

/* 新增：第一个 th 自适应文字大小（宽度随内容） */
table th:first-child {
  width: auto; /* 显式声明自适应（可选，因为默认就是 auto） */
  white-space: nowrap; /* 可选：避免文字换行（若需换行可删除此句） */
}

table td:first-child {
  width: auto; /* 宽度随内容自动调整 */
  white-space: nowrap; /* 可选：避免文字换行 */
}

table tr:nth-child(odd) {
  background: var(--color-bg-primary);  /* 第一行颜色 */
}

table tr:nth-child(even) {
  background: var(--color-bg-secondary);    /* 第二行颜色 */
}

h1, h2, h3, h4 {
  font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "WenQuanYi Micro Hei","Microsoft Yahei", sans-serif;
}

input[type="text"]:not(.nav-search-input),
input[type="email"],
input[type="url"],
input[type="password"],
textarea {
  padding: var(--spacing-xs);
  border: 1px solid var(--color-border-primary);
  width: 100%;
  border-radius: 2px;
  box-sizing: border-box;
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  outline: none;
}

input[type="text"]:not(.nav-search-input):hover,
input[type="email"]:hover,
input[type="url"]:hover,
input[type="password"]:hover,
textarea:hover {
  border-color: var(--color-border-secondary);
}

input[type="text"]:not(.nav-search-input):focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
textarea:focus {
  border-color: var(--color-border-secondary);
}

textarea {
  resize: vertical;
}

.hidden {
  display: none !important;
  visibility: hidden;
}

.invisible {
  visibility: hidden;
}

/* ============================================
 * 公共工具类 - Flex布局
 * ============================================ */

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-start {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.flex-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* ============================================
 * 1楼：固定顶部用户导航栏
 * ============================================ */

.fixed-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--color-bg-primary);
  height: 36px;
  padding: 0;
  border-bottom: 1px solid var(--color-border-primary);
  box-sizing: border-box;
}

.fixed-nav.scrolled {
  border-bottom: 1px solid var(--color-border-secondary);
}

.header-nav-wrapper.scrolled {
  display: none;
}

.header-nav-wrapper.show-mobile-nav {
  display: block;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  height: 36px;
}

.nav-left {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.nav-left .home-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 8px;
}

.nav-left .nav-logo-small {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 4px;
  margin-left: 8px;
}

.nav-left .nav-site-title {
  font-size: 12px;
  white-space: nowrap;
  color: var(--color-text-secondary);
  line-height: 1;
}

.nav-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}

.nav-center .nav-menu {
  display: none !important;
}

.fixed-nav.scrolled .nav-center .nav-menu {
  display: flex !important;
  animation: slideDown 0.5s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-right {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.user-auth {
  display: flex;
  gap: 0;
  align-items: center;
}

.user-auth a {
  color: var(--color-text-primary);
  text-decoration: none;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}

.user-auth a i {
  font-size: 12px;
  line-height: 1;
}

.user-auth a:hover {
  background: var(--color-bg-secondary);
}

.user-info {
  position: relative;
  display: flex;
  align-items: center;
}

.user-avatar-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 20px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.user-avatar-container:hover {
  background: var(--color-bg-secondary);
}

.user-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--color-border-primary);
  object-fit: cover;
}

.user-name {
  font-size: 12px;
  color: var(--color-text-primary);
  font-weight: 500;
  white-space: nowrap;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--color-white);
  border: 1px solid var(--color-border-primary);
  border-radius: 4px;
  padding: 8px 0;
  min-width: 120px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.user-info:hover .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown a {
  display: block;
  padding: 8px 16px;
  color: var(--color-text-primary);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.user-dropdown a:hover {
  background: var(--color-bg-secondary);
}

.mobile-nav-container {
  position: fixed;
  top: 36px;
  left: 0;
  right: 0;
  z-index: 997;
  background: var(--color-bg-primary);
  border-bottom: 1px solid var(--color-border-primary);
  display: none;
  visibility: hidden;
  padding: 0 15px;
  height: 36px;
  align-items: center;
  justify-content: center;
}

.mobile-nav-container.show {
  display: flex;
  visibility: visible;
}

/* ============================================
 * 2楼：三格布局LOGO区域
 * ============================================ */

.second-floor {
  background: var(--color-bg-primary);
  position: relative;
  z-index: 999;
  padding: 0;
  min-height: 100px;
  display: flex;
  align-items: center;
}

.second-floor-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--global-max-width);
  margin: 0 auto;
  width: 100%;
  padding: 0 20px;
}

.second-floor-left {
  flex: 0 0 200px;
  display: flex;
  align-items: center;
}

.second-floor-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  height: 100%;
}

.logo-link:hover {
  opacity: 0.8;
}

.logo-svg {
  width: 100%;
  max-width: 400px;
  height: auto;
  display: block;
}

.logo-link:hover .logo-svg text:first-of-type {
  fill: var(--color-text-primary);
}

.second-floor-right {
  flex: 0 0 200px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.second-floor-nav {
  display: none;
  padding: 0 15px;
  height: 36px;
  background: var(--color-bg-primary);
  border-top: 1px solid var(--color-border-primary);
  border-bottom: 1px solid var(--color-border-primary);
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.second-floor-nav.show {
  display: flex;
}

.second-floor-nav .nav-menu {
  display: flex !important;
  flex-wrap: nowrap;
  justify-content: center;
  margin: 0;
  padding: 0;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.second-floor-nav .nav-menu a {
  padding: 4px 8px;
  font-size: 14px !important;
  white-space: nowrap;
  flex-shrink: 0;
  height: 28px;
  line-height: 20px;
}

/* ============================================
 * 3楼：导航栏
 * ============================================ */

.header-nav-wrapper {
  width: 100%;
  background: var(--color-bg-primary);
  border-top: 1px solid var(--color-border-primary);
  border-bottom: 1px solid var(--color-border-primary);
  position: relative;
  z-index: 998;
}

.third-floor-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  height: 36px;
  box-sizing: border-box;
}

.third-floor-left {
  flex: 0 0 200px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  height: 100%;
  min-width: 0;
  overflow: hidden;
}

.third-floor-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  overflow: hidden;
}

.third-floor-right {
  flex: 0 0 200px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  min-width: 0;
  overflow: hidden;
}

.nav-menu {
  flex: 1;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

.nav-menu a {
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: none;
  height: 36px;
  color: var(--color-text-secondary);
  position: relative;
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: transparent;
}

.nav-menu a.current::after {
  background: var(--color-text-proper);
}

.nav-menu a:hover {
  color: var(--color-link-hover);
}

.nav-menu .current {
  color: var(--color-text-proper);
}

/* ============================================
 * 滚动搜索框
 * ============================================ */

.scrolled-search-container {
  position: fixed;
  top: 36px;
  left: 0;
  right: 0;
  z-index: 997;
  background: var(--color-bg-primary);
  border-bottom: 1px solid var(--color-border-primary);
  display: none;
  animation: slideDown 0.5s ease;
}

.scrolled-search-container.show {
  display: block;
}

.scrolled-search-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
}

.scrolled-search-wrapper .search-form {
  display: flex;
  align-items: center;
}

.scrolled-search-wrapper .search-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
  border: 1px solid var(--color-border-primary);
  border-radius: 20px;
  background: var(--color-bg-secondary);
  overflow: hidden;
}

.scrolled-search-wrapper .search-input-wrapper:hover {
  border-color: var(--color-border-secondary);
}

.scrolled-search-wrapper .search-input-wrapper:focus-within {
  border-color: var(--color-border-secondary);
}

.scrolled-search-wrapper .search-input {
  flex: 1;
  padding: 8px 12px;
  border: none !important;
  background: transparent !important;
  color: var(--color-text-primary);
  font-size: 14px;
  outline: none;
}

.scrolled-search-wrapper .search-input-wrapper:focus-within {
  outline: none;
  background: var(--color-bg-secondary) !important;
  box-shadow: var(--focus-shadow);
}

.scrolled-search-wrapper .search-button {
  padding: 8px 12px;
  background: transparent !important;
  color: var(--color-text-primary);
  border: none !important;
  cursor: pointer;
  font-size: 14px;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scrolled-search-wrapper .search-button:hover {
  color: var(--color-secondary);
}

/* ============================================
 * 4楼：主内容区域
 * ============================================ */

/* Flex 布局 - 侧边栏边框延伸到主内容高度 */
.flex-layout {
  display: flex !important;
  align-items: stretch;
}

/* Flex 布局下重置 row 的浮动和清除样式 */
.row.flex-layout:after {
  content: none;
}

/* 确保 flex 布局下的列元素正常显示 */
.row.flex-layout > [class*="col-"] {
  float: none !important;
}

/* 文章列表样式 */
.post {
  padding: var(--spacing-lg);
  display: flex;
  max-width: 100%;
  margin: var(--spacing-lg) 0;
  border: 1px solid var(--color-border-primary);
  transition: border-color var(--transition-base);
  box-sizing: border-box;
}

.post:hover {
  border-color: var(--color-border-suitable);
}

.post:hover a {
  color: var(--color-link-hover);
}

/* 分类和标题容器 */
.post-header {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
}

/* 分类样式 */
.post-category {
  font-size: 12px;
  padding: var(--spacing-xs) var(--spacing-md);
  background-color: var(--color-bg-button);
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.5;
}

.post-category a {
  text-decoration: none;
  color: var(--color-white);
}

.post-category a:hover {
  color: var(--color-link);
}

/* 标题样式 */
.post .post-title {
  margin: 0;
  font-size: 14px !important;
  font-weight: 500;
  flex: 1;
  line-height: 1.5;
}

.post .post-title a {
  color: var(--color-text-primary);
  text-decoration: none;
  transition: color var(--transition-base);
  font-size: 14px !important;
  line-height: 1.5;
}

.post .post-title a:hover {
  color: var(--color-link);
}

/* 有封面图片的文章布局 */
.post.has-cover {
  display: flex;
  gap: 25px;
  align-items: flex-start;
}

/* 文章元数据 */
/* 共同的样式 */
.post-meta-comment,
.post-meta {
  padding: 0;
  margin: 10px 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

/* 评论元数据 - 居中 */
.post-meta-comment {
  text-align: center;
  justify-content: center;
}

/* 普通元数据 - 左对齐 */
.post-meta {
  text-align: left;
  justify-content: flex-start;
}

/* 共同的 li 样式 */
.post-meta-comment li,
.post-meta li {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  list-style: none;
  padding: var(--spacing-sm) var(--spacing-md);
  width: auto; 
  font-size: var(--font-size-xs);
  color: var(--color-light);
  transition: all var(--transition-base);
  white-space: nowrap; 
}

.post-meta-comment li i,
.post-meta li i {
  margin-right: 6px;
}

.post-meta-comment li:hover,
.post-meta li:hover {
  background: var(--color-bg-gray);
  color: var(--color-white);
}

.post-meta-comment li span,
.post-meta-comment li a,
.post-meta li span,
.post-meta li a {
  color: inherit;
  text-decoration: none;
}

.post-meta-comment li a:hover,
.post-meta li a:hover {
  color: inherit;
}

/* 文章内容 */
.post-content {
  
  line-height: var(--line-height-normal);
  color: var(--color-secondary); 
}

.post-content h2 {
  font-size: var(--font-size-lg);  
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight); 
  margin: 1.5em 0 0.5em;
  letter-spacing: -0.01em;
}

.post-content strong {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}


.post .tags {
  clear: both;
}

/* 封面图片 */
.post-cover {
  flex-shrink: 0;
  width: 180px;
}

.post-cover img {
  width: 150px;
  height: 150px;
  object-fit: cover;
}

/* 内容包装器 */
.post-content-wrapper {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  transition: max-height var(--transition-base);
}

/* 分类列表标题 */
.category-list h2,
.category-list h3 {
  font-size: 14px;
  font-weight: normal;
  line-height: 1.5;
  border-bottom: 1px solid var(--color-border-primary);
  padding-bottom: 10px;
}

/* 20. 阅读全部按钮样式*/
.read-more-btn {
  display: block; 
  width: 100%;   
  margin-top: 15px;
  padding: 8px 20px;
  background: var(--color-bg-gray);
  border: none;
  border-radius: 4px;
  color: var(--color-white);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  text-align: center;  
}

.read-more-btn:hover {
  background: var(--color-bg-suitable);
  color: var(--color-white);
}

/* ============================================
 * 子分类导航
 * ============================================ */

.simple-subcats {
  margin-top: 40px;
  font-size: 14px;
  line-height: 1.6;
  border-bottom: 1px solid var(--color-border-primary);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding-bottom: 0;
  position: relative;
}

.simple-subcats .label a {
  display: inline-block;
  margin: 0 10px 10px 0;
  padding: 2px var(--spacing-sm);
  background: var(--color-bg-button);
  color: var(--color-white);
  text-decoration: none;
}

.simple-subcats a {
  display: inline-block;
  margin: 0 10px 10px 0;
  padding: 2px var(--spacing-sm);
  text-decoration: none;
  border-bottom: none;
  color: var(--color-text-primary);
  position: relative;
}

.simple-subcats a::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  right: 0;
  height: 1px;
  background: transparent;
  transition: background var(--transition-base);
}

.simple-subcats a:hover::after,
.simple-subcats a.current::after {
  background: var(--color-border-suitable);
}

.simple-subcats a:hover {
  color: var(--color-link);
}

.simple-subcats a.current {
  color: var(--color-text-proper);
  font-weight: bold;
}

/* ============================================
 * 侧边栏
 * ============================================ */

.perch {
  margin-top: 44px;
  font-size: 14px;
  line-height: 1.6;
}

.widget .widget-title {
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--color-border-primary);
  font-size: var(--font-size-base);
  font-weight: bold;
  color: var(--color-text-primary);
}

.widget {
  margin-bottom: 30px;
}

/* 小部件列表中的标题 */
.widget-list h4 {
  font-size: 14px;
  font-weight: bold;
  color: var(--color-text-primary);
  padding: 10px 0;
  margin: 15px 0 10px 0;
}

/* 子分类标题 */
.sub-category-title {
  font-size: 12px;
  color: var(--color-text-primary);
  padding: 8px 0;
  margin: 0 0 10px 0;
  border-bottom: 1px solid var(--color-border-primary);
}



/* 提交按钮样式 */
.submit {
  display: inline-block;  
  padding: 6px 16px;
  font-size: 14px;
  font-weight: normal;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  border: none;
  background-color: var(--color-bg-button);
  color: var(--color-white);
  text-decoration: none;
  transition: background-color 0.3s ease;
  box-sizing: border-box;
}
.submit:hover {
  background-color: var(--color-bg-gray);
}

/* ============================================
 * 评论区域
 * ============================================
 */

#comments {
  padding-top: 15px;
}

/* 评论标题和按钮容器 */
.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.comments-header h3 {
  margin: 0;
  flex: 1;
  font-weight: normal;
  font-size: 14px;
}

.comments-header .submit {
  display: inline-block;
  width: auto;
  padding: 8px 16px;
  font-size: 14px;
  white-space: nowrap;
}

/* 评论列表 */
.comment-list,
.comment-list ol {
  list-style: none;
  margin: 15px 0;
  padding: 0;
}

.comment-list li {
  padding: 5px 14px;
  margin-top: 10px;
  border: 1px solid var(--color-border-primary);
}

/* 合并奇数行和作者样式 */
.comment-list li.comment-level-odd,
.comment-list li.comment-by-author {
  background: var(--color-bg-secondary);
}

.comment-list li.comment-level-even {
  background: var(--color-white);
}

/* 评论内容 */
.comment-content p {
  margin: 0;
  color: var(--color-text-light);
}

/* 评论作者 */
.comment-author {
  display: block;
  margin-bottom: 3px;
}

.comment-author .avatar {
  float: left;
  margin-right: 10px;
}

.comment-author cite {
  font-style: normal;
}

/* 评论回复链接 */
.comment-list li .comment-reply {
  text-align: right;
  font-size: .92857em;
}

/* 回复表单 */
.comment-list .respond {
  margin-top: 15px;
  border-top: 1px solid var(--color-border-primary);
}

.respond .cancel-comment-reply {
  float: right;
  margin-top: 15px;
  font-size: .92857em;
}

/* 评论表单 */
.comment-form label {
  display: block;
  margin-bottom: .5em;
  font-weight: bold;
}

.comment-form .required:after {
  content: " *";
  color: var(--color-text-secondary);
}

/* 移动端适配 */
@media (max-width: 768px) {
  .comments-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .comments-header .submit {
    width: 100%;
    text-align: center;
  }
}
/* ============================================
 * 分页
 * ============================================ */

/* 分页导航 */
.page-navigator {
  margin: 25px 0;
  text-align: center;
  list-style: none;
}

.page-navigator li {
  display: inline-block;
  margin: 0 4px;
}

.page-navigator a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-bg-gray);
  color: var(--color-white);
  text-decoration: none;
  transition: all 0.3s ease;
}

.page-navigator a:hover {
  background: var(--color-bg-button);
  transform: scale(1.1);
}

.page-navigator .current a {
  background: var(--color-black);
}

/* ============================================
 * 响应式设计
 * ============================================ */

@media (max-width: 768px) {
  .second-floor {
    z-index: 996;
    min-height: 80px;
  }
  
  .second-floor-container {
    padding: 15px;
  }
  
  .second-floor-left,
  .second-floor-right {
    flex: 0 0 60px;
  }
  
  .logo-svg {
    max-width: 200px;
  }
  
  .nav-container {
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 36px;
  }
  
  .nav-left .nav-site-title {
    font-size: 11px;
    margin-left: 4px;
  }
  
  .fixed-nav.scrolled .nav-left .nav-site-title {
    display: block !important;
  }
  
  .nav-center {
    display: none !important;
  }
  
  .nav-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
  }
  
  .header-nav-wrapper {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    z-index: 997;
    background: var(--color-bg-primary);
    border-bottom: 1px solid var(--color-border-primary);
    display: block;
  }
  
  .header-nav-wrapper.show-mobile-nav {
    display: none;
  }
  
  .second-floor-nav {
    display: none;
    padding: 0 15px;
    height: 36px;
    background: var(--color-bg-primary);
    border-top: 1px solid var(--color-border-primary);
    border-bottom: 1px solid var(--color-border-primary);
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }
  
  .second-floor-nav.show {
    display: flex;
  }
  
  .second-floor-nav .nav-menu {
    flex-wrap: nowrap;
    justify-content: center;
    margin: 0;
    padding: 0;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    display: flex !important;
  }
  
  .second-floor-nav .nav-menu a {
    padding: 4px 8px;
    white-space: nowrap;
    flex-shrink: 0;
    height: 28px;
    line-height: 20px;
    font-size: 14px !important;
  }
  
  .mobile-nav-container {
    position: fixed;
    top: 36px;
    left: 0;
    right: 0;
    z-index: 997;
    background: var(--color-bg-primary);
    border-bottom: 1px solid var(--color-border-primary);
    display: none;
    visibility: hidden;
    padding: 0 15px;
    height: 36px;
    align-items: center;
    justify-content: center;
  }
  
  .mobile-nav-container.show {
    display: flex;
    visibility: visible;
  }
  
  .mobile-nav-container .nav-menu {
    flex-wrap: nowrap;
    justify-content: center;
    margin: 0;
    padding: 0;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    display: flex !important;
  }
  
  .mobile-nav-container .nav-menu a {
    padding: 4px 8px;
    white-space: nowrap;
    flex-shrink: 0;
    height: 28px;
    line-height: 20px;
    font-size: 14px !important;
  }
  
  .third-floor-container {
    padding: 0 15px;
    height: 36px;
    flex-wrap: nowrap;
  }
  
  .third-floor-left,
  .third-floor-right {
    display: none;
  }
  
  .third-floor-center {
    flex: 1 1 0%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
  }
  
  .nav-menu {
    flex-wrap: nowrap;
    justify-content: center;
    margin: 0;
    padding: 0;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    display: flex !important;
  }
  
  .nav-menu a {
    padding: 4px 8px;
    white-space: nowrap;
    flex-shrink: 0;
    height: 28px;
    line-height: 20px;
    font-size: 14px !important;
  }
  
  .scrolled-search-container {
    display: none;
  }
  
  .scrolled-search-container.show {
    display: block;
    top: 72px;
  }
  
  .user-name {
    display: none;
  }
  }

/* ============================================
 * 页脚
 * ============================================ */

.footer {
  padding: 3em 0;
  line-height: 1.5;
  text-align: center;
  color: var(--color-text-light);
  border-top: 1px solid var(--color-border-primary);
}

.footer .container {
  max-width: var(--global-max-width);
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

.footer .row {
  text-align: left;
  margin-bottom: 20px;
}

.footer h4 {
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border-primary);
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin-bottom: 10px;
  line-height: 1.6;
}

.footer-links li i {
  margin-right: 8px;
  color: var(--color-text-light);
}

.footer-links a {
  color: var(--color-text-light);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--color-link);  /* 修复：改为两个横杠 */
}

.footer-links span {
  color: var(--color-text-light);
}

/* ============================================
 * 文章左侧工具栏
 * ============================================ */

.post-sidebar-toolbar {
  position: fixed;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 10000;
  padding: 0 10px;
  box-sizing: border-box;
}

/* 移动端隐藏工具栏 */
@media (max-width: 768px) {
  .post-sidebar-toolbar {
    display: none;
  }
}

/* 桌面端正常显示（768px以上） */
@media (min-width: 769px) {
  .post-sidebar-toolbar .toolbar-icon {
    width: 32px;
    height: 32px;
    background: var(--color-text-white);
    border: 1px solid var(--color-border-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-base);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  
  /* 其余样式保持不变 */
  .post-sidebar-toolbar .toolbar-icon i {
    font-size: 16px;
    color: var(--color-text-primary);
    transition: color var(--transition-base);
  }
  
  .post-sidebar-toolbar .toolbar-icon:hover {
    background: var(--color-text-white);
    border-color: var(--color-border-suitable);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }
  
  /* Tooltip 样式 */
  .post-sidebar-toolbar .toolbar-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-bg-button);
    color: var(--color-white);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 4px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 10001;
  }
  
  .post-sidebar-toolbar .toolbar-icon:hover::after {
    opacity: 1;
    visibility: visible;
  }
  
  .post-sidebar-toolbar .toolbar-back-top {
    display: flex;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.4s, transform 0.4s, background var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
  }
  
  .post-sidebar-toolbar .toolbar-back-top.visible {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============================================
 * 侧边栏 Sticky 滚动效果
 * ============================================ */

/* 侧边栏容器确保有足够高度 */
.secondary,
.secondary-right,
.sidebar-right {
    will-change: transform;
    transition: transform 0.2s ease;
}

/* 移动端禁用 sticky */
@media screen and (max-width: 1000px) {
    .secondary,
    .secondary-right,
    .sidebar-right {
        position: relative !important;
        top: auto !important;
    }
}

/* 全局低于 1280px 时隐藏左侧侧栏 */
@media screen and (max-width: 1279px) {
    /* 隐藏左侧侧栏 */
    .secondary {
        display: none;
    }
    
    /* 调整主内容区域宽度 */
    #main {
        width: 100% !important;
        flex: 1;
    }
}

/* ============================================
 * 滚动标尺特效 - 配置说明
 * ============================================
 * 
 * 【标尺容器样式】
 * - width: 18px          // 标尺整体宽度
 * - background: #000000  // 标尺背景颜色（黑色）
 * 
 * 【刻度线样式】
 * 所有刻度线高度统一为 1px，通过 width 控制长度
 * 
 * 次要刻度 (minor):  宽度 6px,  白色 80% 透明度
 * 中等刻度 (medium): 宽度 10px, 白色 90% 透明度  
 * 主要刻度 (major):  宽度 14px, 白色 100% 透明度
 * 
 * 【修改指南】
 * 1. 修改标尺背景色：更改 .scroll-ruler 的 background 值
 * 2. 修改刻度线颜色：更改各 .ruler-mark.xxx::before 的 background 值
 * 3. 修改刻度线长度：更改各 .ruler-mark.xxx::before 的 width 值
 * 4. 修改刻度线高度：更改各 .ruler-mark.xxx::before 的 height 值（建议保持 1px）
 * ============================================ */

.scroll-ruler {
  position: fixed;
  right: 0;
  top: 0;
  width: 18px;              /* 标尺整体宽度 */
  height: 100vh;
  background: #000;      /* 标尺背景颜色 - 黑色 */
  border-left: 1px solid var(--color-border-primary);
  z-index: 1000;
  overflow: hidden;
}

.ruler-container {
  position: relative;
  height: 100%;
}

.ruler-pointer {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: #ff0000;
  box-shadow: 0 0 8px rgba(255, 0, 0, 0.5);
  z-index: 9999;
  transition: top 0.1s ease;
}

.ruler-pointer::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -4px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 8px solid #f00;
}

.ruler-mark {
  position: absolute;
  left: 0;
  width: 100%;
  height: 10px;
  font-size: 10px;
  color: #fff;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
}

.ruler-mark span {
  display: inline-block;
  white-space: nowrap;
  opacity: 0.9;
}

/* 树形分支效果 - 横向横线 */
.ruler-mark::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 1px;
  background: var(--color-border-primary);
}

/* 
 * 【次要刻度】每 10px 一个
 * 特点：最密集，最短，不显示数字
 */
.ruler-mark.minor {
  font-size: 0;
  color: rgba(255, 255, 255, 0.5);
}

.ruler-mark.minor::before {
  width: 6px;                           /* 刻度线长度 */
  height: 1px;                          /* 刻度线高度（建议保持 1px） */
  background: rgba(255, 255, 255, 0.8); /* 刻度线颜色 - 白色 80% 透明度 */
}

.ruler-mark.minor span {
  display: none;                        /* 不显示数字 */
}

/* 
 * 【中等刻度】每 50px 一个
 * 特点：中等密度，中等长度，显示数字
 */
.ruler-mark.medium {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.9);
}

.ruler-mark.medium::before {
  width: 10px;                          /* 刻度线长度 - 比次要刻度长 */
  height: 1px;                          /* 刻度线高度（建议保持 1px） */
  background: rgba(255, 255, 255, 0.9); /* 刻度线颜色 - 白色 90% 透明度 */
}

.ruler-mark.medium span {
  margin-left: 12px;                    /* 数字与刻度线的间距 */
}

/* 
 * 【主要刻度】每 100px 一个
 * 特点：最稀疏，最长，显示数字且最清晰
 */
.ruler-mark.major {
  font-size: 10px;
  color: #ffffff;                       /* 数字颜色 - 纯白色 */
  font-weight: normal;
}

.ruler-mark.major::before {
  width: 14px;                          /* 刻度线长度 - 最长 */
  height: 1px;                          /* 刻度线高度（建议保持 1px） */
  background: rgba(255, 255, 255, 1);   /* 刻度线颜色 - 纯白色 100% 透明度 */
}

.ruler-mark.major span {
  margin-left: 16px;
}

/* ============================================
 * 左侧标尺 - 浅色主题配置
 * ============================================
 * 
 * 【左侧标尺容器样式】
 * - background: #F7F7F7  // 浅灰色背景
 * - border-right: 右侧边框
 * 
 * 【左侧刻度线样式】
 * 所有刻度线为黑色，与右侧标尺形成对比
 * 
 * 次要刻度 (minor):  宽度 6px,  黑色 60% 透明度
 * 中等刻度 (medium): 宽度 10px, 黑色 70% 透明度  
 * 主要刻度 (major):  宽度 14px, 黑色 100% 透明度
 * 
 * 【左侧指针样式】
 * - 红色指针，与右侧标尺保持一致
 * ============================================ */

/* 左侧标尺基础样式 - 浅灰色背景 */
.scroll-ruler--light {
  background: #f7f7f7;      /* 浅灰色背景 */
  border-left: none;
  border-right: 1px solid var(--color-border-primary);
}

/* 左侧标尺指针 - 红色（与右侧保持一致） */
.scroll-ruler--light .ruler-pointer {
  background: #ff0000;
  box-shadow: 0 0 8px rgba(255, 0, 0, 0.5);
}

.scroll-ruler--light .ruler-pointer::before {
  border-top-color: #f00;
}

/* 左侧标尺刻度数字颜色 - 黑色 */
.scroll-ruler--light .ruler-mark {
  color: #000;
}

/* 
 * 【左侧次要刻度】黑色
 */
.scroll-ruler--light .ruler-mark.minor {
  color: rgba(0, 0, 0, 0.5);
}

.scroll-ruler--light .ruler-mark.minor::before {
  background: rgba(0, 0, 0, 0.6);   /* 黑色 60% 透明度 */
}

/* 
 * 【左侧中等刻度】黑色
 */
.scroll-ruler--light .ruler-mark.medium {
  color: rgba(0, 0, 0, 0.8);
}

.scroll-ruler--light .ruler-mark.medium::before {
  background: rgba(0, 0, 0, 0.7);   /* 黑色 70% 透明度 */
}

/* 
 * 【左侧主要刻度】黑色
 */
.scroll-ruler--light .ruler-mark.major {
  color: #000000;                   /* 纯黑色数字 */
}

.scroll-ruler--light .ruler-mark.major::before {
  background: rgba(0, 0, 0, 1);     /* 纯黑色 100% 透明度 */
}