:root {
  color-scheme: light;
  --ink: #292629;
  --muted: #756f76;
  --paper: #f7f6f3;
  --surface: #fffefd;
  --line: #dedbd7;
  --accent: #ef7946;
  --accent-dark: #b94f27;
  --mint: #cfe7d9;
  --mint-dark: #39705a;
  --rose: #f2d5d9;
  --rose-dark: #965765;
  --sky: #d7e5ee;
  --sky-dark: #416879;
  --lemon: #f2e7b9;
  --code: #2b3032;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(239, 121, 70, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(57, 112, 90, 0.03) 1px, transparent 1px),
    var(--paper);
  background-size: 44px 44px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

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

img {
  max-width: 100%;
}

.shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 254, 253, 0.94);
  backdrop-filter: blur(14px);
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.site-brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.site-brand img {
  width: 44px;
  height: 44px;
  border: 2px solid var(--surface);
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 0 0 2px var(--rose);
  transform: rotate(-2deg);
}

.site-brand span {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.site-brand strong {
  font-size: 1rem;
}

.site-brand small {
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--rose-dark);
  background: var(--rose);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
}

.site-nav a {
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.blog-intro {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.intro-grid {
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  align-items: center;
  gap: 88px;
  padding: 64px 0;
}

.eyebrow {
  width: fit-content;
  margin: 0 0 22px;
  padding: 5px 9px;
  border: 1px solid #acd4c0;
  border-radius: 6px;
  color: var(--mint-dark);
  background: #e6f3ec;
  font-size: 0.76rem;
  font-weight: 850;
}

.intro-grid h1 {
  max-width: 720px;
  margin: 0;
  font-family: ui-serif, "Noto Serif SC", "Songti SC", SimSun, serif;
  font-size: 4.35rem;
  font-weight: 760;
  line-height: 1.08;
}

.intro-lead {
  max-width: 590px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.intro-profile {
  position: relative;
  width: min(100%, 320px);
  margin: 0;
  justify-self: end;
}

.intro-profile::before,
.intro-profile::after {
  content: "";
  position: absolute;
  z-index: 2;
  width: 48px;
  height: 16px;
  background: var(--lemon);
  opacity: 0.92;
}

.intro-profile::before {
  top: 4px;
  left: -13px;
  transform: rotate(-10deg);
}

.intro-profile::after {
  right: -12px;
  bottom: 56px;
  transform: rotate(8deg);
}

.portrait-wrap {
  padding: 10px;
  border: 1px solid #d7cfd1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 14px 16px 0 var(--sky);
  transform: rotate(1.5deg);
}

.portrait-wrap img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  object-fit: cover;
}

.intro-profile figcaption {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 4px 0;
}

.intro-profile figcaption strong {
  font-family: ui-serif, "Noto Serif SC", "Songti SC", SimSun, serif;
  font-size: 1.1rem;
}

.intro-profile figcaption span {
  color: var(--muted);
  font-size: 0.82rem;
}

.post-feed,
.archive-page,
.post-page {
  padding-top: 64px;
  padding-bottom: 84px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin: 0;
  font-family: ui-serif, "Noto Serif SC", "Songti SC", SimSun, serif;
  font-size: 1.55rem;
}

.section-heading a,
.back-link,
.read-link {
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 760;
}

.post-list {
  display: grid;
  gap: 18px;
}

.post-card {
  position: relative;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 44px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 0 rgba(41, 38, 41, 0.035);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.post-card:nth-child(3n + 1) {
  border-left: 6px solid var(--rose);
}

.post-card:nth-child(3n + 2) {
  border-left: 6px solid var(--mint);
}

.post-card:nth-child(3n) {
  border-left: 6px solid var(--sky);
}

.post-card:hover {
  transform: translateY(-2px);
  border-color: #cfc9c5;
  box-shadow: 0 12px 0 rgba(239, 121, 70, 0.07);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
}

.post-card > .post-meta {
  align-content: start;
}

.post-meta a {
  color: var(--mint-dark);
}

.meta-separator {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.post-card-body {
  min-width: 0;
}

.post-card h3 {
  margin: 0;
  font-family: ui-serif, "Noto Serif SC", "Songti SC", SimSun, serif;
  font-size: 2rem;
  line-height: 1.25;
}

.post-card h3 a:hover {
  color: var(--accent-dark);
}

.post-card p {
  max-width: 740px;
  margin: 14px 0 18px;
  color: var(--muted);
}

.post-card p:empty {
  display: none;
}

.read-link {
  display: inline-block;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--accent);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-inner {
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-inner p {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

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

.post-page {
  width: min(820px, calc(100% - 40px));
}

.post-header {
  position: relative;
  padding: 12px 0 42px;
  border-bottom: 1px solid var(--line);
}

.post-header::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: -7px;
  width: 56px;
  height: 13px;
  background: var(--rose);
  transform: rotate(-3deg);
}

.post-header .post-meta {
  margin-top: 28px;
}

.post-header h1 {
  margin: 14px 0 0;
  font-family: ui-serif, "Noto Serif SC", "Songti SC", SimSun, serif;
  font-size: 3.25rem;
  line-height: 1.18;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.post-tags a {
  color: var(--mint-dark);
  font-size: 0.86rem;
  font-weight: 700;
}

.post-content {
  padding: 38px 0 20px;
  font-size: 1.04rem;
}

.post-content > *:first-child {
  margin-top: 0;
}

.post-content h2,
.post-content h3,
.post-content h4 {
  scroll-margin-top: 24px;
  line-height: 1.35;
}

.post-content h2 {
  margin: 2.4em 0 0.75em;
  font-size: 1.7rem;
}

.post-content h3 {
  margin: 2em 0 0.65em;
  font-size: 1.28rem;
}

.post-content p,
.post-content ul,
.post-content ol {
  margin: 1.15em 0;
}

.post-content a {
  color: var(--accent-dark);
  text-decoration: underline;
  text-decoration-color: rgba(185, 78, 25, 0.38);
  text-underline-offset: 3px;
}

.post-content blockquote {
  margin: 1.6em 0;
  padding: 14px 18px;
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  color: var(--muted);
  background: #fff7f2;
}

.post-content blockquote p {
  margin: 0.6em 0;
}

.post-content img {
  display: block;
  height: auto;
  margin: 2em auto;
  border: 6px solid white;
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--line), 8px 10px 0 var(--sky);
}

.post-content code {
  padding: 0.15em 0.38em;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #e9ece9;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.9em;
}

.post-content pre,
.post-content figure.highlight {
  overflow-x: auto;
  margin: 1.8em 0;
  padding: 20px;
  border-radius: 8px;
  color: #e8eeee;
  background: var(--code);
  font-size: 0.88rem;
  line-height: 1.65;
}

.post-content pre code,
.post-content figure.highlight code {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
}

.post-content figure.highlight table {
  width: auto;
  margin: 0;
  border: 0;
}

.post-content figure.highlight td {
  padding: 0;
  border: 0;
}

.post-content figure.highlight .gutter {
  padding-right: 16px;
  color: #788286;
  user-select: none;
}

.post-content table {
  display: block;
  width: 100%;
  overflow-x: auto;
  margin: 1.8em 0;
  border-collapse: collapse;
}

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

.post-content hr {
  margin: 3em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.post-navigation {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.post-navigation a {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.post-navigation a:hover {
  border-color: var(--accent);
  box-shadow: 6px 6px 0 var(--rose);
}

.post-navigation small,
.post-navigation strong {
  display: block;
}

.post-navigation small {
  color: var(--muted);
}

.post-navigation strong {
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.next-post {
  text-align: right;
}

.archive-header {
  padding-bottom: 42px;
  border-bottom: 1px solid var(--line);
}

.archive-header h1 {
  margin: 0;
  font-family: ui-serif, "Noto Serif SC", "Songti SC", SimSun, serif;
  font-size: 3rem;
}

.archive-header > p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
}

.archive-list article {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 110px;
  align-items: center;
  gap: 28px;
  margin-top: 12px;
  padding: 20px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.archive-list time,
.archive-list span {
  color: var(--muted);
  font-size: 0.84rem;
}

.archive-list h2 {
  min-width: 0;
  margin: 0;
  font-size: 1.2rem;
}

.archive-list h2 a:hover {
  color: var(--accent-dark);
}

.archive-list span {
  color: var(--mint-dark);
  text-align: right;
}

.pagination {
  margin-top: 38px;
}

.pagination .page-number,
.pagination .extend {
  display: inline-flex;
  min-width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.pagination .current {
  color: white;
  border-color: var(--ink);
  background: var(--ink);
}

@media (max-width: 760px) {
  .shell,
  .post-page {
    width: min(100% - 28px, 1120px);
  }

  .header-inner {
    min-height: 64px;
  }

  .site-brand img {
    width: 38px;
    height: 38px;
  }

  .site-brand small {
    display: none;
  }

  .site-nav {
    gap: 14px;
    font-size: 0.84rem;
  }

  .site-nav a:nth-last-child(1) {
    display: none;
  }

  .intro-grid {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 44px;
    padding: 50px 0 56px;
  }

  .intro-grid h1 {
    font-size: 3rem;
  }

  .intro-profile {
    width: min(86%, 300px);
    justify-self: center;
  }

  .post-feed,
  .archive-page,
  .post-page {
    padding-top: 44px;
    padding-bottom: 58px;
  }

  .post-card {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 24px 20px;
  }

  .post-card h3 {
    font-size: 1.6rem;
  }

  .post-header h1 {
    font-size: 2.35rem;
  }

  .post-content {
    font-size: 1rem;
  }

  .archive-header h1 {
    font-size: 2.35rem;
  }

  .archive-list article {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .archive-list span {
    text-align: left;
  }

  .footer-inner {
    display: block;
    padding: 24px 0;
  }

  .footer-links {
    margin-top: 10px;
  }
}

@media (max-width: 430px) {
  .intro-grid h1 {
    font-size: 2.55rem;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 6px;
  }

  .post-navigation {
    grid-template-columns: 1fr;
  }

  .next-post {
    text-align: left;
  }
}
