:root {
  --main-color: #000;
  --background-color: #fff;
  --font-size: 18px;
  --font-size-small: 16px;
  --font-size-xsmall: 14px;
  --border-color: #000;
  --button-bg-color: #000;
  --button-hover-bg-color: #333;
}

::selection {
  background-color: #ffef3d; /* 自定义背景色 */
}

html {
  scroll-behavior: smooth; /* 启用 CSS 平滑滚动 */
}

body {
  font-family: "Source Han Sans", "Microsoft YaHei", "PingFang SC", "SimSun",
    sans-serif;
  background-color: var(--background-color);
  color: var(--main-color);
  margin: 0;
  padding: 0;
  line-height: 1.75;
  overflow-x: hidden;
  font-size: var(--font-size);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  width: 90%;
  max-width: 800px;
  margin: 2rem auto;
  background-color: var(--background-color);
  padding: 2rem;
  border: 2px solid var(--border-color);
  word-break: break-all;
  box-sizing: border-box;
  box-shadow: 1px 1px 0px -1px #434343, 1px 1px #434343;
  border-radius: 0.25rem;
  border-top-left-radius: 250px 10px;
  border-top-right-radius: 15px 204px;
  border-bottom-left-radius: 15px 257px;
  border-bottom-right-radius: 230px 15px;
  position: relative;
}

header {
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  margin-bottom: 1.5rem;
  box-sizing: border-box;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
  box-sizing: border-box;
}

.logo h1 {
  margin: 0;
  font-size: 2rem;
  color: var(--main-color);
  text-transform: uppercase;
  padding-bottom: 0.25rem;
}

.red-point{
  position: relative;
}

.red-point::before{
  content: " ";
  border: 3px solid red;/*设置红色*/
  border-radius:3px;/*设置圆角*/
  position: absolute;
  z-index: 1000;
  right: 0;
  margin-right: -8px;
}

.nav-toggle {
  display: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

.nav-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  margin-bottom: 5px;
  background-color: var(--main-color);
}

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

nav a {
  margin: 0 1rem;
  text-decoration: none; /* 确保没有下划线 */
  color: var(--main-color);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

.highlight-link {
  background-color: transparent;
  background-image: -webkit-linear-gradient(#ffe21d, #ffe21d);
  background-image: -o-linear-gradient(#ffe21d, #ffe21d);
  background-image: linear-gradient(#ffe21d, #ffe21d);
  background-position: 0 85%;
  background-size: 100% 20%;
  background-repeat: no-repeat;
  text-decoration: none; /* 去掉下划线 */
  font-weight: bold; /* 字体加粗 */
}

h1,
h2,
h3 {
  color: var(--main-color);
  font-family: "Georgia", serif;
  font-weight: normal;
  margin-top: 0;
  box-sizing: border-box;
}

h1 {
  font-size: 36px;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  text-transform: uppercase;
  text-align: center;
  font-weight: 700;
}

h2 {
  font-size: 28px;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  text-transform: uppercase;
  font-weight: 700;
}

h3 {
  font-size: 24px;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

p {
  font-size: var(--font-size, 18px); /* 提高默认字体大小 */
  line-height: 1.8; /* 增加行高 */
  margin-bottom: 1.5rem;
  text-align: justify;
  text-indent: 2em;
  color: var(--main-color, #333); /* 默认颜色 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: "Microsoft YaHei", "SimSun", "SimHei", "Heiti SC", "STHeiti",
    sans-serif; /* 常用中文字体 */
  font-weight: 500; /* 适中的字体粗细 */
}

/* 针对 main 和 article 中 p 元素内 a 链接的所有状态 */
main p a,
article p a,
ul li a {
  background-color: transparent;
  background-image: -webkit-linear-gradient(#d3d3d3, #d3d3d3);
  background-image: -o-linear-gradient(#d3d3d3, #d3d3d3);
  background-image: linear-gradient(#d3d3d3, #d3d3d3);
  background-position: 0 85%;
  background-size: 100% 20%;
  background-repeat: no-repeat;
  text-decoration: none; /* 默认无下划线 */
  font-weight: bold; /* 字体加粗 */
  color: inherit; /* 默认颜色 */
}

main p a:hover,
main p a:focus,
article p a:hover,
article p a:focus,
ul li a:hover,
ul li a:focus {
  color: #666666; /* 悬停或焦点时设置字体颜色为灰色 */
  background-size: 100% 100%; /* 更改悬停时的背景大小 */
  transition: background-size 0.3s ease-in-out; /* 添加过渡效果 */
}

main p a:active,
article p a:active,
ul li a:active {
  color: #333333; /* 链接点击时的颜色为深灰色 */
  text-decoration: none; /* 点击时去掉下划线 */
}

main p a:visited,
article p a:visited {
  color: #555555; /* 访问过的链接颜色为中灰色 */
}



.byline,
.footer {
  text-align: right;
  font-style: italic;
  color: var(--main-color);
  margin-top: -1rem;
  margin-bottom: 1.5rem;
  box-sizing: border-box;
}

footer {
  border-top: 1px solid var(--border-color);
  font-size: 14px;
  padding: 1rem 0;
  margin-top: 2rem;
  box-sizing: border-box;
  text-align: right;
}

footer a {
  text-decoration: none; /* 去掉下划线 */
  color: black; /* 设置字体颜色为黑色 */
  font-weight: bold; /* 设置字体加粗 */
  font-size: 14px; /* 设置字体大小 */
  padding: 5px; /* 设置内边距 */
}

footer a:hover {
  color: gray; /* 悬停时设置字体颜色为灰色 */
  text-decoration: underline; /* 悬停时显示下划线 */
}

footer div {
  font-size: var(--font-size-xsmall);
  color: var(--main-color);
}

footer p {
  margin: 0;
  font-size: var(--font-size-xsmall);
}

.read-more {
  text-align: right;
  font-size: 1.125rem;
  box-sizing: border-box;
}

.pagination a {
  color: var(--main-color);
  text-decoration: none;
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  transition: color 0.3s, border-color 0.3s, background-color 0.3s;
}

.pagination a:hover {
  color: #fff;
  background-color: var(--main-color);
  border-color: var(--main-color);
}

article {
  margin-bottom: 2.5rem;
  box-sizing: border-box;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
}

/* 延迟加载占位符的样式 */
.lozad {
  background: linear-gradient(135deg, #f0f0f0, #e0e0e0); /* 渐变背景 */
  width: 100%;
  aspect-ratio: 16 / 9; /* 保持宽高比 */
  display: block; /* 让占位符呈现块状 */
  position: relative; /* 位置相对 */
  overflow: hidden; /* 隐藏溢出的内容 */
  color: #888; /* 占位符文字颜色 */
  font-size: 16px; /* 占位符文字大小 */
  font-family: Arial, sans-serif; /* 占位符文字字体 */
  line-height: 1.5; /* 占位符文字行高 */
  text-align: center; /* 文字居中 */
  opacity: 1; /* 初始透明度 */
  transition: opacity 0.3s ease-in-out; /* 平滑过渡 */
}

/* 显示加载中提示 */
.lozad::before {
  content: "加载中...";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* 图片加载完成后的样式 */
.lozad.loaded {
  opacity: 0; /* 使占位符透明 */
  transition: opacity 0.3s ease-in-out; /* 加载完成过渡 */
  background: none; /* 移除背景 */
}

article img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
  border: 2px solid #4d4343;
  border-top-left-radius: 250px 10px;
  border-top-right-radius: 15px 204px;
  border-bottom-left-radius: 15px 257px;
  border-bottom-right-radius: 230px 15px;
  position: relative;
}


.article-footer {
  display: flex;
  justify-content: space-between; /* 左右分布 */
  align-items: center; /* 垂直居中 */
  margin-top: 1.5rem; /* 调整与上部的间距 */
}


code {
  text-decoration: underline;
}

.meta {
  display: flex;
  align-items: center; /* 垂直居中时间和标签 */
  gap: 1rem; /* 时间和标签之间的间距 */
  font-size: 0.875rem; /* 调整字体大小 */
  color: #666; /* 更柔和的颜色 */
}

.read-more {
  text-align: right; /* 继续阅读内容右对齐 */
  margin-top: 0; /* 去除按钮的上边距 */
}

.read-more a {
  color: var(--main-color); /* 主色调 */
  text-decoration: none;
  border: 1px solid var(--main-color);
  padding: 0.5rem 1rem; /* 内边距调整按钮大小 */
  font-size: 0.875rem; /* 调整字体大小 */
  line-height: 1.75; /* 行高调整 */
  border-radius: 0; /* 去掉圆角 */
  transition: color 0.3s, border-color 0.3s, background-color 0.3s;
}

.read-more a:hover,
.read-more a:focus {
  color: #fff; /* 悬停时的字体颜色 */
  background-color: var(--main-color); /* 悬停时的背景颜色 */
  border-color: var(--main-color); /* 悬停时的边框颜色 */
  outline: none; /* 去掉默认的焦点边框 */
}

.post-meta {
  display: flex;
  justify-content: flex-end;
  font-size: 0.9em;
  color: #666;
  margin-bottom: 15px;
}

.published-date,
.author {
  margin-left: 15px;
}


.edit a {
  text-decoration: none; /* 去除下划线 */
  color: #666; /* 设置链接颜色 */
}

.comments {
  margin-top: 2.5rem;
}

.comment-form {
  display: flex;
  flex-direction: column;
  padding-top: 1.5rem;
}

.comment-form .form-group {
  width: 100%;
  margin-bottom: 1.5rem;
  box-sizing: border-box;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 0.5rem;
  font-size: var(--font-size);
  border: 1px solid var(--border-color);
  background-color: var(--background-color);
  color: #333;
  border-radius: 0;
  box-sizing: border-box;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.comment-form textarea {
  resize: vertical;
  min-height: 120px;
}

.comment-form button {
  padding: 0.5rem 1.5rem;
  font-size: var(--font-size);
  color: #fff;
  background-color: var(--button-bg-color);
  border: 1px solid var(--border-color);
  border-radius: 0;
  cursor: pointer;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  transition: background-color 0.3s;
}

.comment-form button:hover {
  background-color: var(--button-hover-bg-color);
}

.comment-list .comment {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0;
  background-color: var(--background-color);
}

.comment-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.user-info img,
.comment-header .avatar {
  border-radius: 50%;
  width: 40px;
  height: 40px;
  margin-right: 0.5rem;
  -o-object-fit: cover;
  object-fit: cover;
  border-top-left-radius: 250px 10px;
  border-top-right-radius: 15px 204px;
  border-bottom-left-radius: 15px 257px;
  border-bottom-right-radius: 230px 15px;
  border: 2px solid #4d4343;
  position: relative;

  /* 占位符样式 */
  background-color: #e0e0e0; /* 灰色背景作为占位符 */
  background-size: cover;
  background-position: center;
  transition: opacity 0.3s ease; /* 过渡效果 */
  opacity: 0; /* 隐藏实际图片 */
}

/* 实际图片加载完成后显示 */
.user-info img.loaded,
.comment-header .avatar.loaded {
  opacity: 1;
}

.comment-header .comment-author {
  font-weight: bold;
  color: var(--link-color);
  text-decoration: none;
}

.comment-header .comment-author:hover {
  text-decoration: underline;
}

.comment-text {
  margin-bottom: 0;
}

.at {
    text-decoration: none; /* 去除下划线 */
  color: #666; /* 设置链接颜色 */
}
.comment-footer {
  display: flex;
  justify-content: space-between; /* 默认的两个元素分布 */
  align-items: center;
}

.comment-footer > *:only-child {
  margin-left: auto; /* 单个子元素时推到右侧 */
}

.comment-edit {
  font-size: 0.875rem;
  color: #666;
}

.comment-edit a {
  text-decoration: none; /* 去除下划线 */
  color: #666; /* 设置链接颜色 */
}

.comment-time {
  font-size: 0.875rem;
  color: #666;
}

.reply-link {
  color: var(--reply-link-color);
  text-decoration: none;
  margin-left: auto;
}

.reply-link:hover {
  text-decoration: underline;
}

.reply-list {
  margin-top: 1rem;
}

.comment-reply-form {
  display: none;
}

.comment-reply-form.active {
  display: block;
}

.comment-list .comment .comment-header {
  margin-top: 0.5rem;
}

.comment-list .comment .reply-link {
  margin-left: auto;
  text-decoration: none; /* 默认无下划线 */
  font-weight: 500; /* 稍微加粗 */
}


@media (min-width: 768px) {
  .comment-form {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1%;
  }

  .comment-form .form-group {
    flex: 1 1 calc(33.33% - 1%);
  }

  .comment-form .form-group:nth-child(4) {
    flex: 1 1 100%;
    width: calc(100% - 2rem);
  }

  .comment-form .form-group:last-child {
    flex: 1 1 100%;
    display: flex;
    justify-content: flex-end; /* 右对齐 */
  }

  .comment-form button {
    width: auto;
    max-width: 200px;
    margin-top: 0;
  }
}

.hidden {
  display: none;
}
.user-info {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* 左对齐 */
  margin-top: 20px;
}

.welcome-message {
  font-size: 1em; /* 调整字体大小 */
  text-align: center; /* 文本居中 */
}
.welcome-message a {
  color: #333; /* 用户名链接颜色 */
  text-decoration: none;
}
.welcome-message a:hover {
  text-decoration: underline; /* 鼠标悬停时显示下划线 */
}

/* 样式针对 .welcome-message p 元素 */
.welcome-message p {
  font-size: 18px; /* 调整字体大小 */
  margin: 0; /* 去除默认的边距 */
  text-align: center; /* 文本居中对齐 */
  text-indent: 0; /* 去除首行缩进 */
}

.pagination {
  text-align: center;
  margin: 1.5rem 0;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.pagination a,
.pagination .page-info {
  margin: 0.25rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0;
  box-sizing: border-box;
  display: inline-block;
  line-height: 1.8;
  font-size: var(--font-size-xsmall);
}

.notification {
  display: none;
  position: fixed;
  top: 10px;
  right: 10px;
  background-color: var(--background-color);
  color: var(--main-color);
  padding: 10px 15px;
  z-index: 1;
  border: 1px solid var(--border-color);
  height: auto;
  line-height: 1.2;
}

.dismissBtn {
  cursor: pointer;
  margin-left: 10px;
  font-size: 18px;
}

.dismissBtn:hover {
  color: black;
}

#scrollButton {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #007bff;
  color: white;
  border: 2px solid #4d4343;
  border-radius: 5px; /* 圆角矩形 */
  box-shadow: 3px 3px 0px -1px #434343, 3px 3px #434343;
  padding: 0.5em;
  cursor: pointer;
  display: none; /* 默认隐藏按钮 */
  z-index: 1000; /* 确保按钮在最上层 */
  text-align: center;
  font-size: 0.875em; /* 调整字体大小 */
  width: 50px; /* 正方形宽度 */
  height: 50px; /* 正方形高度 */
}

#scrollButton:hover {
  background-color: #0056b3;
}

.table-container {
  overflow-x: auto;
  padding: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  background-color: #fff;
  color: #333;
}

th,
td {
  padding: 10px;
  text-align: left;
  border: 1px solid #ccc;
}

thead {
  background-color: #000;
  color: #fff;
}

tbody tr:nth-child(odd) {
  background-color: #f9f9f9;
}

tbody tr:nth-child(even) {
  background-color: #fff;
}

/* 响应式设计 */
@media (max-width: 768px) {
  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }

  thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  tr {
    border: 1px solid #ccc;
    margin-bottom: 10px;
    display: block;
    background-color: #fff;
  }

  td {
    border: none;
    display: block;
    text-align: right;
    position: relative;
    padding-left: 50%;
  }

  td::before {
    content: attr(data-label);
    position: absolute;
    left: 0;
    width: 50%;
    padding-left: 10px;
    font-weight: bold;
    text-align: left;
  }
}

/* 图片占位图 */
.placeholder {
  display: flex; /* 使用 flexbox 布局 */
  justify-content: center; /* 水平居中对齐 */
  align-items: center; /* 垂直居中对齐 */
  width: 200px; /* 设置宽度 */
  height: 200px; /* 设置高度 */
  background-color: #f0f0f0; /* 背景颜色 */
  cursor: pointer; /* 鼠标悬停时显示指针 */
  font-size: 16px; /* 设置字体大小 */
  color: #555; /* 设置文字颜色 */
  border: 2px solid #4d4343; /* 统一边框样式 */
  box-sizing: border-box; /* 确保边框不影响元素大小 */
  text-align: center; /* 水平居中对齐文本 */
  margin: 0 auto; /* 在父容器中水平居中 */
  max-width: 100%; /* 响应式设计 */
  border-top-left-radius: 250px 10px; /* 圆角设置 */
  border-top-right-radius: 15px 204px;
  border-bottom-left-radius: 15px 257px;
  border-bottom-right-radius: 230px 15px;
  position: relative; /* 相对定位，为子元素定位作准备 */
  overflow: hidden; /* 防止内容溢出圆角边框 */
}


@media (max-width: 600px) {
  body {
    font-size: var(--font-size-small);
  }

  .container {
    width: 95%;
    max-width: 100%;
    padding: 1rem;
    box-sizing: border-box;
  }

  .header-content {
    flex-direction: column;
    align-items: center;
  }

  .nav-toggle {
    display: block;
    margin: 1rem 0;
    box-sizing: border-box;
  }

  .logo {
    display: none;
  }

  .article-footer .tags {
    display: none;
  }

  nav {
    display: none;
    text-align: center;
    margin-bottom: 1rem;
  }

  nav.show {
    display: block;
  }

  nav a {
    display: block;
    margin: 0.5rem 0;
    box-sizing: border-box;
  }

  .footer {
    text-align: center;
  }

  .pagination {
    flex-direction: column;
    align-items: center;
  }

  .pagination a,
  .pagination .page-info {
    width: 100%;
    text-align: center;
    margin: 0.25rem 0;
    box-sizing: border-box;
  }

  footer div {
    font-size: 0.75rem;
  }
}
