:root {
  --paper: #f7f6f2;
  --surface: #ffffff;
  --ink: #202321;
  --muted: #717773;
  --line: #dfe2dd;
  --accent: #b34b32;
  --accent-dark: #873621;
  --forest: #315b55;
  --hero-text-overlay-opacity: 0.2;
  --content-width: 1240px;
  --reading-width: 1240px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body,
button,
input {
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

ul,
ol {
  margin: 0;
}

::selection {
  color: #fff;
  background: var(--forest);
}

.wrap {
  min-height: calc(100vh - 150px);
}

.page-navigation {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  height: 72px;
  border-bottom: 1px solid rgba(32, 35, 33, 0.1);
  background: rgba(247, 246, 242, 0.94);
  backdrop-filter: blur(14px);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 48px), var(--content-width));
  height: 72px;
  margin: 0 auto;
}

.home-link {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.brand-mark {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 700;
}

.brand-description {
  color: var(--muted);
  font-size: 12px;
}

.main-nav-items {
  display: flex;
  align-items: center;
  gap: 34px;
  padding: 0;
  list-style: none;
}

.main-nav-items a {
  position: relative;
  display: block;
  color: #555b57;
  font-size: 14px;
  font-weight: 500;
  line-height: 72px;
  transition: color 160ms ease;
}

.main-nav-items a::after {
  position: absolute;
  right: 0;
  bottom: 17px;
  left: 0;
  height: 2px;
  background: var(--accent);
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 160ms ease;
}

.main-nav-items a:hover {
  color: var(--ink);
}

.main-nav-items a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.navbar-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 11px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.navbar-toggle .icon-bar {
  display: block;
  width: 22px;
  height: 2px;
  margin: 5px 0;
  background: var(--ink);
  transition: transform 160ms ease, opacity 160ms ease;
}

.prince-container {
  position: relative;
  width: min(calc(100% - 48px), var(--content-width));
  margin: 0 auto;
}

.home-hero {
  position: relative;
  width: 100vw;
  height: clamp(420px, calc(100vh - 72px), 700px);
  margin: 0 0 64px calc(50% - 50vw);
  overflow: hidden;
  background: #e8ebe7;
}

.home-hero-image {
  display: block;
  width: 100%;
  height: 100%;
}

.home-hero-image {
  object-fit: cover;
  object-position: center;
  transition: opacity 240ms ease;
}

.site-intro {
  display: grid;
  position: absolute;
  right: max(24px, calc((100vw - var(--content-width)) / 2));
  bottom: 0;
  left: max(24px, calc((100vw - var(--content-width)) / 2));
  z-index: 2;
  min-height: 0;
  padding: 80px 0 52px;
  align-content: center;
  color: #F7F6F2;
}

.site-intro::before {
  position: absolute;
  top: 40px;
  bottom: 24px;
  left: -18px;
  z-index: -1;
  width: min(265px, calc(100vw - 48px));
  background: rgba(0, 0, 0, var(--hero-text-overlay-opacity));
  content: "";
}

.site-kicker,
.section-kicker {
  margin: 0 0 12px;
  font-family: "Courier New", monospace;
  font-size: 12px;
  font-weight: 700;
}

.site-kicker {
  color: #F7F6F2;
}

.section-kicker {
  color: var(--accent);
}

.site-intro h1 {
  max-width: 780px;
  margin: 0;
  color: #F7F6F2;
  font-family: Georgia, "Songti SC", SimSun, serif;
  font-size: 46px;
  font-weight: 600;
  line-height: 1.22;
}

.site-description {
  margin: 18px 0 0;
  color: #F7F6F2;
  font-size: 16px;
}

.intro-rule {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 36px;
  color: #F7F6F2;
  font-size: 12px;
}

.intro-rule::before {
  width: 52px;
  height: 2px;
  background: #F7F6F2;
  content: "";
}

.articles {
  width: 100%;
}

.articles .post-block {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.28fr);
  gap: 42px;
  padding: 48px 0;
  border-bottom: 1px solid var(--line);
}

.post-header {
  display: flex;
  flex-direction: column;
}

.post-title {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Songti SC", SimSun, serif;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.post-link {
  transition: color 160ms ease;
}

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

.post-info {
  order: -1;
  margin-bottom: 13px;
  color: var(--muted);
  font-family: "Courier New", monospace;
  font-size: 12px;
}

.post-summary {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

.post-summary p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #555b57;
  font-size: 15px;
  line-height: 1.9;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow-wrap: anywhere;
}

.post-meta {
  display: flex;
  grid-column: 2;
  align-items: center;
  justify-content: space-between;
  margin-top: -22px;
}

.article-more {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.article-more i {
  transition: transform 160ms ease;
}

.article-more:hover i {
  transform: translateX(4px);
}

.post-tags-box {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.post-tags-box ul,
.post-tags-box li {
  display: contents;
  padding: 0;
  list-style: none;
}

.post-tags-box a {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  transition: border-color 160ms ease, color 160ms ease;
}

.post-tags-box a:hover {
  border-color: var(--forest);
  color: var(--forest);
}

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.post-layout > .post,
.post-layout > .toc {
  grid-area: 1 / 1;
}

.post {
  width: min(100%, var(--reading-width));
  margin: 0 auto;
}

.post > .post-block {
  margin: 0;
  padding: 72px 0 60px;
}

.article-header {
  margin-bottom: 52px;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--line);
}

.article-header .post-title {
  max-width: 1180px;
  margin-bottom: 18px;
  font-size: 40px;
  line-height: 1.32;
}

.article-header .post-info {
  display: block;
  margin-bottom: 14px;
}

.post-gallery > p:not(:first-child) {
  display: none;
}

.post-entry {
  color: #2b302d;
  font-family: Georgia, "Songti SC", "Noto Serif CJK SC", SimSun, serif;
  font-size: 17px;
  line-height: 2;
  overflow-wrap: anywhere;
}

.post-entry p {
  margin: 0 0 1.45em;
}

.post-entry h1,
.post-entry h2,
.post-entry h3,
.post-entry h4,
.post-entry h5,
.post-entry h6 {
  margin: 2.1em 0 0.8em;
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 700;
  line-height: 1.45;
}

.post-entry h1 { font-size: 28px; }
.post-entry h2 { font-size: 24px; }
.post-entry h3 { font-size: 20px; }
.post-entry h4,
.post-entry h5,
.post-entry h6 { font-size: 17px; }

.post-entry a:not(.fancybox) {
  color: var(--accent-dark);
  border-bottom: 1px solid rgba(179, 75, 50, 0.35);
  transition: border-color 160ms ease, color 160ms ease;
}

.post-entry a:not(.fancybox):hover {
  color: var(--accent);
  border-color: var(--accent);
}

.post-entry a.headerlink {
  margin-left: 8px;
  border: 0;
  color: var(--line);
}

.post-entry blockquote {
  margin: 2em 0;
  padding: 20px 26px;
  border-left: 3px solid var(--forest);
  background: #eef2ef;
  color: #4f5954;
}

.post-entry blockquote p:last-child {
  margin-bottom: 0;
}

.post-entry ul,
.post-entry ol {
  margin: 0 0 1.5em;
  padding-left: 1.5em;
}

.post-entry li {
  margin-bottom: 0.45em;
}

.post-entry hr {
  height: 1px;
  margin: 3em 0;
  border: 0;
  background: var(--line);
}

.post-entry img {
  margin: 2em auto;
}

.post-entry .fancybox {
  display: block;
  border: 0;
}

code,
kbd,
pre,
samp {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.post-entry code {
  padding: 2px 5px;
  background: #eceeeb;
  color: #8d3522;
  font-size: 0.85em;
}

.post-entry pre,
.post-entry .highlight {
  overflow-x: auto;
  margin: 1.8em 0;
  border: 1px solid #333a37;
  background: #272c29 !important;
  color: #e9ece9;
  font-size: 13px;
  line-height: 1.7;
}

.post-entry pre {
  padding: 18px 20px;
}

.highlight table {
  width: auto;
  margin: 0;
  border: 0;
}

.highlight td {
  padding: 0;
  border: 0;
}

.highlight pre {
  margin: 0;
  border: 0;
}

.highlight .gutter pre {
  padding-right: 12px;
  color: #7f8983;
  background: #222623 !important;
  text-align: right;
  user-select: none;
}

.highlight .code pre {
  padding-left: 16px;
}

.post-entry pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.post-entry table:not(.highlight table) {
  display: block;
  overflow-x: auto;
  width: 100%;
  margin: 2em 0;
  border-collapse: collapse;
}

.post-entry th,
.post-entry td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.post-entry th {
  background: #eef0ed;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 600;
}

.post-download {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 2.2em 0;
}

.post-entry .post-download-btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  padding: 7px 15px;
  border: 1px solid var(--forest);
  color: var(--forest);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  font-weight: 600;
  transition: background 160ms ease, color 160ms ease;
}

.post-entry .post-download-btn:hover {
  border-color: var(--forest);
  background: var(--forest);
  color: #fff;
}

.toc {
  display: none;
}

.section-header {
  padding: 72px 0 38px;
  border-bottom: 1px solid var(--line);
}

.section-header h1 {
  margin: 0 0 8px;
  font-family: Georgia, "Songti SC", SimSun, serif;
  font-size: 40px;
  font-weight: 600;
}

.section-header p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.archive {
  width: 100%;
  padding: 24px 0 70px;
}

.post-item {
  border-bottom: 1px solid var(--line);
}

.post-item-link {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 20px;
  gap: 24px;
  align-items: center;
  min-height: 78px;
  transition: color 160ms ease;
}

.post-item-link .post-date {
  color: var(--muted);
  font-family: "Courier New", monospace;
  font-size: 12px;
}

.post-item-link .post-title {
  overflow: hidden;
  font-family: Georgia, "Songti SC", SimSun, serif;
  font-size: 19px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-item-link i {
  color: var(--line);
  transition: color 160ms ease, transform 160ms ease;
}

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

.post-item-link:hover i {
  color: var(--accent);
  transform: translateX(4px);
}

.paginator,
.post-nav {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  width: 100%;
  margin: 24px 0 64px;
  gap: 20px;
}

.post-nav {
  width: min(100%, var(--reading-width));
  margin-right: auto;
  margin-left: auto;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.prev-wrap,
.next-wrap {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.next-wrap {
  margin-left: auto;
  text-align: right;
}

.paginator a {
  color: var(--muted);
  font-size: 14px;
}

.post-nav a {
  display: flex;
  min-width: 0;
  max-width: 300px;
  flex-direction: column;
}

.post-nav small {
  color: var(--muted);
  font-size: 11px;
}

.post-nav span {
  overflow: hidden;
  font-family: Georgia, "Songti SC", SimSun, serif;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.paginator a:hover,
.post-nav a:hover {
  color: var(--accent);
}

.copyright {
  border-top: 1px solid var(--line);
  background: #eceeea;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 48px), var(--content-width));
  min-height: 126px;
  margin: 0 auto;
  color: var(--muted);
}

.footer-inner p {
  margin: 0;
  font-size: 12px;
}

.footer-name {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

.footer-meta {
  display: flex;
  gap: 10px;
}

.footer-meta a:hover {
  color: var(--accent);
}

@media (min-width: 1800px) {
  .post-layout > .toc {
    position: sticky;
    top: 112px;
    display: block;
    overflow-y: auto;
    width: 190px;
    max-height: calc(100vh - 150px);
    padding-left: 18px;
    border-left: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    align-self: start;
    justify-self: end;
    transform: translateX(220px);
  }

  .toc ol {
    padding-left: 12px;
    list-style: none;
  }

  .toc > li,
  .toc ol > li {
    margin: 6px 0;
    list-style: none;
  }

  .toc a:hover {
    color: var(--accent);
  }
}

@media (max-width: 767px) {
  .page-navigation,
  .nav-container {
    height: 64px;
  }

  .nav-container,
  .prince-container,
  .footer-inner {
    width: min(calc(100% - 32px), var(--content-width));
  }

  .brand-description {
    display: none;
  }

  .navbar-toggle {
    display: block;
  }

  .navbar-toggle.is-open .icon-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .navbar-toggle.is-open .icon-bar:nth-child(2) {
    opacity: 0;
  }

  .navbar-toggle.is-open .icon-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .main-nav-items {
    position: absolute;
    top: 64px;
    right: 0;
    left: 0;
    display: none;
    gap: 0;
    padding: 8px 16px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
  }

  .main-nav-items.is-open {
    display: block;
  }

  .main-nav-items a {
    height: 46px;
    border-bottom: 1px solid var(--line);
    line-height: 46px;
  }

  .main-nav-items a::after {
    display: none;
  }

  .home-hero {
    height: 470px;
    margin-top: 20px;
  }

  .site-intro {
    right: 24px;
    left: 24px;
    padding: 104px 0 34px;
  }

  .site-intro::before {
    top: 62px;
    bottom: 16px;
    left: -12px;
    width: min(265px, calc(100vw - 48px));
  }

  .site-intro h1 {
    font-size: 34px;
  }

  .intro-rule {
    margin-top: 26px;
  }

  .articles .post-block {
    display: block;
    padding: 36px 0;
  }

  .post-title {
    font-size: 24px;
  }

  .post-summary {
    margin-top: 18px;
  }

  .post-summary p {
    -webkit-line-clamp: 5;
  }

  .post-meta {
    margin-top: 20px;
  }

  .post > .post-block {
    padding: 48px 0 42px;
  }

  .article-header {
    margin-bottom: 36px;
    padding-bottom: 26px;
  }

  .article-header .post-title {
    font-size: 30px;
  }

  .post-entry {
    font-size: 16px;
    line-height: 1.95;
  }

  .section-header {
    padding: 48px 0 30px;
  }

  .section-header h1 {
    font-size: 32px;
  }

  .post-item-link {
    grid-template-columns: 1fr 18px;
    gap: 12px;
    min-height: 86px;
  }

  .post-item-link .post-date {
    grid-column: 1;
    margin-bottom: -8px;
  }

  .post-item-link .post-title {
    grid-column: 1;
    font-size: 17px;
  }

  .post-item-link i {
    grid-row: 1 / 3;
    grid-column: 2;
  }

  .post-nav {
    flex-direction: column;
  }

  .post-nav .next-wrap {
    width: 100%;
    justify-content: flex-end;
  }

  .post-nav a {
    max-width: calc(100vw - 76px);
  }

  .footer-inner {
    min-height: 116px;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
