html {
  --paper-background: #ede2d0;
  --paper-surface: #e6d8c3;
  --paper-line: #d4c2a7;
  --paper-accent: #886247;
  --paper-grid: rgba(136, 98, 71, 0.045);
  color: #333333;
  background-color: var(--paper-background);
  /* Subtle 16px grid: static CSS lines keep the texture behind the text. */
  background-image:
    linear-gradient(var(--paper-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--paper-grid) 1px, transparent 1px);
  background-size: 16px 16px;
  scroll-behavior: smooth;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: 'Slince Rounded', 'Yuanti SC', 'Hiragino Maru Gothic ProN', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-variant-numeric: tabular-nums;
  /* Keep code symbols distinct instead of combining them into ligatures. */
  font-variant-ligatures: none;
}
body {
  max-width: 680px;
  padding: 0 14px;
  margin: 0 auto;
}
* {
  -webkit-tap-highlight-color: transparent;
}
ol,
ul {
  list-style: none;
}
p,
h1,
h2,
h3,
h4,
h5,
ul,
ol,
li,
blockquote {
  padding: 0;
  margin: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
input,
select,
textarea {
  font-family: inherit;
  outline: 0;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: none;
}
pre,
code {
  font-family: Consolas, Menlo, Monaco, monospace;
}
input:-webkit-autofill {
  /* 自动填充的文本颜色 */
  -webkit-text-fill-color: #333333 !important;
  /* -webkit-text-fill-color: var(--text-color) !important; */

  /* 方式1：使用内阴影覆盖自动填充的背景色 */
  /* box-shadow: 0 0 0 1000px #ffffff inset !important; */

  /* 方式2：通过延迟一个月，取消自动填充的背景色 */
  -webkit-transition: background-color 2592000s ease-in-out 0s;
  transition: background-color 2592000s ease-in-out 0s;
}
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
  background-color: transparent;
}
::-webkit-scrollbar-thumb {
  border-radius: 2px;
  background-color: #999999;
}
::selection {
  background-color: #4a4a4a;
  color: #f9f9f9;
}
.hover-underline {
  position: relative;
}
.hover-underline:after {
  content: '';
  position: absolute;
  width: 100%;
  height: 1px;
  bottom: -2px;
  left: 0;
  background-color: #333333;
  visibility: hidden;
  transform: scaleX(0);
  transition: transform 200ms cubic-bezier(0.32, 0.72, 0, 1);
}
.hover-underline:hover:after {
  visibility: visible;
  transform: scaleX(1);
}
.header {
  padding: 40px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header .logo {
  width: 40px;
  height: 40px;
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 10px;
  user-select: none;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}
.header .menu {
  margin-right: -9px;
  text-align: right;
  user-select: none;
}
.header .menu a {
  display: inline-block;
  font-size: 16px;
  margin: 4px 9px;
  white-space: nowrap;
  user-select: auto;
}
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 0 32px;
  font-size: 14px;
}
.footer .footer-repo {
  display: inline-block;
  max-width: 100%;
  padding: 8px 0;
  color: #766957;
  font-size: 12px;
  line-height: 20px;
  text-decoration: none;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}
.footer .footer-repo:hover { text-decoration: underline; }
.footer .footer-repo:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}
html.dark .footer .footer-repo {
  color: #8b949e;
}
#to-top {
  position: fixed;
  z-index: 99;
  right: 16px;
  bottom: 12px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  border-radius: 10%;
  background-color: #000000;
  opacity: 0.45;
  overflow: hidden;
  transform: translateY(66px);
  transition: transform 200ms ease-in-out;
}
#to-top.show {
  transform: translateY(0);
}
#to-top > span {
  display: block;
  width: 50%;
  height: 50%;
  position: absolute;
  left: 50%;
  top: 13px;
  transform: translateX(-50%) rotate(45deg);
}
#to-top > span:first-child {
  background-color: #ffffff;
}
#to-top > span:last-child {
  background-color: #000000;
  transform: translate(-50%, 16%) rotate(45deg);
}
@media screen and (max-width: 560px) {
  .header {
    padding: 35px 0 20px 0;
    justify-content: flex-start;
  }
  .header .menu {
    margin-right: -2px;
    text-align: left;
  }
  .header .menu a {
    margin: 2px 5px;
    font-size: 15px;
  }
}

.language-switch {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: #f5f5f5;
  transition: background-color 200ms cubic-bezier(0.32, 0.72, 0, 1);
}

.language-switch:hover {
  background-color: #e8e8e8;
}

/* 深色主题样式 */
html.dark .language-switch {
  background-color: #2d2d2d;
  color: #ffffff;
}

html.dark .language-switch:hover {
  background-color: #3d3d3d;
}

.language-switch .lang-text {
  font-size: 14px;
}

/* A shared paper palette for the archive, static pages, and articles. */
html:not(.dark) .header {
  box-shadow: inset 0 -1px var(--paper-line);
}

html:not(.dark) .header .menu a[aria-current='page'] {
  color: var(--paper-accent);
}

.header .menu a[aria-current='page']::after {
  visibility: visible;
  transform: scaleX(1);
}

html:not(.dark) .hover-underline::after {
  background-color: var(--paper-accent);
}

html:not(.dark) .language-switch,
html:not(.dark) .page-post blockquote,
html:not(.dark) .page-post code,
html:not(.dark) .page-post pre,
html:not(.dark) .page-post .highlight,
html:not(.dark) .page-post table tr:nth-child(even) {
  background-color: var(--paper-surface);
}

html:not(.dark) .language-switch:hover,
html:not(.dark) .page-post hr {
  background-color: var(--paper-line);
}

html:not(.dark) .page-post blockquote {
  border-left-color: var(--paper-accent);
}

/* Utterances is cross-origin. Blend its light surfaces with our paper color
   without changing the embedded editor, links, or authentication flow. */
.comments-container {
  isolation: isolate;
}

html:not(.dark) .comments-container {
  background-color: var(--paper-background);
}

html:not(.dark) .comments-container .utterances-frame {
  mix-blend-mode: multiply;
}

.page-post .comments-container .utterances-frame {
  opacity: 1;
}

html:not(.dark) ::selection {
  background-color: #e5d5be;
  color: #333333;
}

html:not(.dark) a:focus-visible {
  outline: 2px solid var(--paper-accent);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hover-underline::after, .language-switch { transition: none; }
}
