* {
  box-sizing: border-box;
}
html {
  height: 100%;
}
body {
  margin: 0;
  padding: 20px;
  font: 14px/20px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #333;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
@media (min-width: 992px) {
  body {
    padding: 35px 50px;
  }
}

h1, h2, h3, h4, h5, h6 {
  margin: 1rem 0 1rem 0;
  line-height: 1.25;
  color: #313131;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4, h5, h6 { font-size: 1.1rem; }

img {
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid #555;
}
a.image {
  display: block;
  text-align: center;
  border: 0;
  border-radius: 5px;
  margin: 30px 0;
}
mark {
  background: #eb7350;
  padding: 0 5px;
}
blockquote {
  margin: 40px 0;
  padding: 5px 30px;
  border-left: 5px solid #ccc;
  background: #eee;
}

.logo {
  position: relative;
  margin: 0 auto 35px;
  text-align: center;
  animation: bounce 0.7s both;
}
.logo a {
  display: inline-block;
  width: 100px;
  height: 100px;
  line-height: 100px;
  border: 5px solid #fff;
  border-radius: 50%;
  background: #ddd url("logo_wrapper.png");
  color: #000;
  font-weight: 700;
  font-size: 1.5em;
  text-align: center;
  text-decoration: none;
}
.logo a:hover,
.logo a:focus {
  background: #f14e32;
}
.logo a:hover + .logo-prompt,
.logo a:focus + .logo-prompt {
  display: inline-block !important;
}
@media (max-width: 480px) {
  .logo a:hover + .logo-prompt,
  .logo a:focus + .logo-prompt {
    display: none !important;
  }
}
.logo .logo-prompt {
  position: absolute;
  display: none;
  vertical-align: middle;
  padding: 5px;
  border-radius: 3px;
  background: #666;
  background: rgba(0, 0, 0, 0.5);
  margin-left: 15px;
  color: #fff;
  font-size: 0.8235em;
  text-align: center;
  line-height: 1.2;
  top: 50%;
  margin-top: -10px;
}
.logo .logo-prompt:before {
  content: "";
  border-width: 5px 5px 5px 0;
  border-style: solid;
  border-color: transparent #666;
  border-color: transparent rgba(0, 0, 0, 0.5);
  position: absolute;
  top: 50%;
  left: -5px;
  margin-top: -5px;
}

iframe {
  width: 100%;
  margin: 45px 0 !important;
}
ul, ol {
  margin: 40px 0;
  padding-left: 50px;
}
ul li, ol li {
  word-wrap: break-word;
}
ul img, ol img {
  margin: 40px 0;
  border-radius: 5px;
}
sup {
  vertical-align: top;
  position: relative;
  top: -0.5em;
  margin-left: 1px;
}
time {
  color: #555;
  font-size: 13px;
}

code, pre, .code, .footnotes {
  font-family: Consolas, Monaco, monospace;
}
code {
  color: #757575;
  background: #eee;
  padding: 2px 6px;
  font-size: 13px;
}
pre {
  display: block;
  margin: 0 0 1rem;
  padding: 1rem;
  font-size: 0.8rem;
  line-height: 1.4;
  white-space: pre;
  overflow-x: auto;
  background: #f9f9f9;
  border: 1px solid #ddd;
}
pre code {
  color: inherit;
  background: transparent;
  padding: 0;
  font-size: 100%;
}

table {
  width: 100%;
  table-layout: fixed;
  margin: 45px 0;
}
thead {
  background: #f2f2f2;
}
th {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 15px solid #fff;
}
td {
  padding: 4px 0;
}

.archive-title.code {
  text-align: center;
  font-size: 1.4em; /* ≈ 22.4px (如果根字体是 16px) */
  line-height: 1.4; /* 推荐用无单位数值，表示倍数 */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #333;
}

.archive-divider {
  height: 1px;
  margin: 2em 0;
  background: linear-gradient(to right, transparent, #ccc, transparent);
}

article {
  max-width: 500px;
  margin: 0 auto;
}
article h1.title {
  text-align: center;
  font-size: 1.4em;
  line-height: 1.4em;
}
article .divider {
  height: 1px;
  margin: 2em 0;
  background: linear-gradient(to right, transparent, #ccc, transparent);
}
article .center {
  text-align: center;
}
article hr {
  border: 0;
  border-bottom: 1px solid #000;
  margin: 30px 0;
}
article p {
  font-size: 15px;
  line-height: 1.9em;
  word-wrap: break-word;
}
article .footnote {
  border: 0;
  background: #0087be;
  color: #fff;
  padding: 0 2px;
}
article .footnotes {
  margin: 50px auto;
  font-size: 0.8em;
  color: #666;
}
article .footnotes p {
  line-height: 1rem;
  font-weight: normal;
}
article .footnotes ol {
  margin: 0;
  padding-left: 15px;
}
article .footnotes ol li {
  font-weight: bold;
}
article .footnotes .reversefootnote {
  border: 0;
  color: #0087be;
}
article a:hover {
  color: #eb7350;
  border-color: #eb7350;
}

.back {
  text-align: center;
}
.back a {
  display: inline-block;
  padding: 10px;
  margin: 40px auto 0;
  text-decoration: none;
  border: 0;
}
.back a::before {
  content: "<<";
  margin-right: 5px;
  color: #000;
}

.block {
  display: block;
}

.page-navigation,
.footer {
  max-width: 500px;
  margin: 50px auto 0;
  text-align: center;
  font-size: 0.8rem;
}
.footer {
  margin-top: 50px;
  color: #777;
}
.page-navigation a,
.footer a {
  border: none;
  text-decoration: none;
}

section {
  max-width: 500px;
  margin: 0 auto 50px auto;
}
section ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
section ul li {
  margin: 25px 0;
}
section ul li .title {
  max-width: 100%;
  word-wrap: normal !important;
}
section ul li a {
  text-decoration: none;
  border: 0;
  color: #000;
  box-sizing: border-box;
}
section ul li .post-date {
  float: right;
  margin: 0 0 0 20px;
}
section ul li span {
  display: inline-block;
  color: #757575;
  letter-spacing: 1px;
  text-transform: uppercase;
}
@media (min-width: 992px) {
  section ul li a {
    border-bottom: 2px solid transparent;
  }
  section ul li a:hover {
    border-color: #000;
  }
}

@keyframes bounce {
  0% { transform: translate3d(0, -1000px, 0); }
  60% { transform: translate3d(0, 25px, 0); }
  75% { transform: translate3d(0, -10px, 0); }
  90% { transform: translate3d(0, 5px, 0); }
  100% { transform: none; }
}

/* Highlight.js 语法高亮（保留必要部分） */
.highlight {
  margin: 40px 0;
}
.highlight .c, .highlight .cm, .highlight .c1 { color: #998; font-style: italic; }
.highlight .err { color: #a61717; background: #e3d2d2; }
.highlight .k, .highlight .o, .highlight .kc, .highlight .kd, .highlight .kp, .highlight .kr, .highlight .ow { font-weight: bold; }
.highlight .kt, .highlight .nc { color: #458; font-weight: bold; }
.highlight .m, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .mo, .highlight .il { color: #099; }
.highlight .s, .highlight .sb, .highlight .sc, .highlight .sd, .highlight .s2, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx, .highlight .s1, .highlight .ss { color: #d14; }
.highlight .na, .highlight .no, .highlight .vc, .highlight .vg, .highlight .vi { color: #008080; }
.highlight .nb { color: #0086b3; }
.highlight .ne, .highlight .nf { color: #900; font-weight: bold; }
.highlight .nt { color: #000080; }
.highlight .sr { color: #009926; }
.highlight .bp, .highlight .cp, .highlight .cs { color: #999; }
.highlight .gd { background: #faa; }
.highlight .gi { background: #afa; }
.highlight .ge { font-style: italic; }
.highlight .gr, .highlight .gt { color: #a00; }
.highlight .gh, .highlight .gp, .highlight .nn { color: #999; }
.highlight .go { color: #888; }
.highlight .gu { color: #aaa; }
.highlight .w { color: #bbb; }

/* 评论区 */
#comments {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 15px;
  animation: fade-in-top 0.3s 0.6s backwards;
}

.comment-title {
  margin: 0 0 10px;
  padding-bottom: 0.3em;
  text-align: left;
  color: #304758;
  border-bottom: 1px solid #eaecef;
}

.comment-title a,
[title="Logout"] {
  border: none;
  color: #eb7350;
  font-size: 15px;
}

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

.comment-list li {
  padding: 10px 0 10px 30px;
  margin-top: 10px;
}

.comment-author {
  display: block;
  margin-bottom: 3px;
}

.comment-author .avatar {
  float: left;
  width: 40px;
  height: 40px;
  margin-right: 10px;
  border-radius: 50%;
}

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

.comment-meta a,
.comment-list .comment-reply,
.respond .cancel-comment-reply {
  font-size: 0.92857em;
  color: #999;
}

.comment-list .comment-reply {
  text-align: right;
}

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

.comment-list .respond {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

/* 评论表单 */
#comment-form {
  position: relative;
  padding: 20px;
  background: #fff;
  border-radius: 30px;
  text-align: center;
}

#comment-form label {
  display: block;
  margin-bottom: 0.5em;
  font-weight: bold;
}

#comment-form .required::after {
  content: " *";
  color: #c00;
}

#comment-form input,
#comment-form textarea {
  width: 100%;
  padding: 0.438rem 0.525rem;
  margin-bottom: 10px;
  border: 1px solid #eee;
  border-radius: 0.3125rem;
  outline: 0;
  display: block;
}

#comment-form input {
  height: 2rem;
  line-height: 1rem;
}

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

#comment-form button {
  display: inline-block;
  padding: 6px 20px;
  background: #fff;
  border: 1px solid #5f5f5f;
  color: #5f5f5f;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
}

#comment-form button:hover {
  background: #5f5f5f;
  color: #fff;
}

/* 响应式 */
@media (max-width: 500px) {
  #comments {
    padding: 0 10px;
  }

  #comment-form {
    padding: 15px;
    border-radius: 20px;
  }

  #comment-form button {
    width: 100%;
    margin-top: 5px;
  }
}


/* 返回顶部 */
#gototop {
  position: fixed;
  right: 155px;
  bottom: 25px;
  z-index: 999;
  opacity: 0.9;
  transition: opacity 0.3s, right 0.3s;
}
#gototop:hover {
  opacity: 1;
}
#gototop img {
  display: block;
  cursor: pointer;
}
@media (max-width: 768px) {
  #gototop { right: 15px; }
}
@media (max-width: 375px) {
  #gototop {
    right: 10px;
    bottom: 15px;
  }
}

/* 动画定义（如果未在其他地方定义） */
@keyframes fade-in-top {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 夜间模式变量 */
html.night-mode {
  --bg-color: #1e1e20;
  --text-color: #e0e0e0;
  --heading-color: #fff;
  --link-color: #fff;
  --border-color: #fff;
  --code-bg: #fff;
}

/* 全局样式 */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--heading-color);
}

a {
  color: var(--link-color);
  text-decoration: none;
}
a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

hr {
  border-color: var(--border-color);
}

pre, code {
  background: var(--code-bg);
  color: var(--text-color);
}

/* 归档页标题 */
.title a,
h3.archive-title,
h3.archive-title.code {
  color: var(--link-color, var(--heading-color));
}
h3.archive-title {
  transition: color 0.2s;
}

/* 主题切换按钮 */
#theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background: var(--bg-color);
  color: var(--text-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  z-index: 999;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

#theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  z-index: 9999;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
}

#theme-toggle:hover {
  transform: scale(1.1);
}

/* 移动端优化 */
@media (max-width: 768px) {
  #theme-toggle {
    width: 44px;
    height: 44px;
    top: 15px;
    right: 15px;
    font-size: 18px;
  }
}