:root {
  --bg: #fcfbf8;
  --surface: #ffffff;
  --line: #e8e2d9;
  --line-strong: #d5cbbd;
  --ink: #2b2a28;
  --muted: #5f5a53;
  --accent: #3470b8;
  --accent-soft: rgba(52, 112, 184, 0.12);
  --shadow: 0 18px 36px rgba(43, 42, 40, 0.08);
  --content-width: 720px;
  --article-serif: "Iowan Old Style", "Palatino Linotype", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --article-sans: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --article-code: "IBM Plex Mono", "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Mono", "SFMono-Regular", "SF Mono", Menlo, Consolas, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", monospace;
  font-size: 17px;
  line-height: 1.7;
  overflow-x: hidden;
}

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

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

p,
ul,
ol {
  margin: 0;
}

.page-shell {
  width: min(calc(100% - 40px), var(--content-width));
  margin: 0 auto;
  padding: 28px 0 72px;
}

.site-header {
  position: relative;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.site-brand {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

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

.site-header__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-height: 38px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-weight: 700;
}

.site-header__toggle svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 500;
}

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

.site-nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.28em;
}

.site-nav__muted {
  opacity: 0.78;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
}

.nav-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.nav-icon[aria-current="page"] {
  background: var(--accent-soft);
  text-decoration: none;
}

main {
  padding-top: 28px;
}

.profile-card {
  display: grid;
  grid-template-columns: 154px 1fr;
  gap: 28px;
  align-items: center;
  padding: 28px 0 22px;
  border-bottom: 1px solid var(--line);
}

.profile-card__avatar {
  width: 154px;
  height: 154px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-card h1 {
  margin: 0 0 14px;
  font-size: clamp(2.25rem, 6vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.profile-card p {
  max-width: 32rem;
  color: var(--muted);
  font-size: 1.06rem;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  color: var(--muted);
}

.social-links a:hover {
  color: var(--ink);
}

.social-links svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
}

.post-list,
.search-results {
  margin-top: 40px;
}

.post-list__more {
  margin-top: 26px;
  text-align: center;
}

.post-list__more a {
  color: var(--ink);
  font-weight: 600;
}

.post-teaser,
.search-result {
  padding: 0 0 34px;
  border-bottom: 1px solid rgba(232, 226, 217, 0.88);
}

.post-teaser + .post-teaser,
.search-result + .search-result {
  margin-top: 32px;
}

.post-teaser h2,
.search-result h3,
.archive-month h3,
.article-detail__header h1 {
  margin: 0 0 8px;
  line-height: 1.12;
}

.post-teaser h2,
.search-result h3 a,
.archive-month h3 a,
.article-detail__header h1 {
  color: var(--accent);
}

.post-teaser h2 {
  font-size: clamp(1.7rem, 4vw, 2.2rem);
}

.search-result h3 {
  font-size: 1.45rem;
}

.post-teaser a:hover,
.archive-month a:hover,
.search-result a:hover,
.article-detail__body a:hover,
.site-footer a:hover,
.contact-links a:hover {
  color: var(--ink);
}

.post-meta,
.post-card__meta,
.article-detail__meta-row,
.search-meta,
.archive-count {
  color: var(--muted);
  font-size: 0.94rem;
}

.post-teaser p:last-child,
.search-result p:last-child,
.archive-month p:last-child,
.page-intro p,
.prose-section p,
.prose-section li,
.article-detail__body p {
  color: var(--muted);
}

.page-intro {
  padding-bottom: 20px;
}

.page-intro h1 {
  margin: 0 0 10px;
  font-size: clamp(2.5rem, 6vw, 3.7rem);
  line-height: 1.08;
}

.page-intro p {
  max-width: 34rem;
  font-size: 1.05rem;
  font-style: italic;
}

.archive-group + .archive-group,
.prose-section + .prose-section {
  margin-top: 44px;
}

.archive-group__header,
.prose-section {
  padding-top: 10px;
}

.archive-group__header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--accent);
  margin-bottom: 28px;
}

.archive-group__header h2,
.prose-section h2 {
  margin: 0;
  line-height: 1.15;
}

.archive-group__header h2 {
  font-size: 2.1rem;
}

.archive-month + .archive-month {
  margin-top: 28px;
}

.archive-month h3 {
  font-size: 1.22rem;
}

.archive-month__list {
  display: grid;
  gap: 22px;
  margin-top: 18px;
}

.prose-section {
  border-top: 1px solid var(--line);
}

.prose-section h2 {
  font-size: 1.4rem;
  margin-bottom: 14px;
}

.simple-list {
  padding-left: 22px;
  margin-top: 14px;
}

.simple-list li + li {
  margin-top: 8px;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 18px;
}

.contact-links a {
  color: var(--accent);
}

.article-detail {
  padding-bottom: 10px;
}

.article-detail__header {
  display: grid;
  gap: 18px;
  max-width: 48rem;
  margin: 0 auto;
  padding: 8px 0 26px;
  border-bottom: 1px solid var(--line);
}

.article-detail__header h1 {
  margin: 0;
  max-width: 18ch;
  font-family: var(--article-sans);
  font-size: clamp(2.55rem, 4.8vw, 3.9rem);
  font-weight: 760;
  line-height: 1.03;
  letter-spacing: -0.035em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.article-detail__meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.article-detail__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  font-family: var(--article-sans);
  font-size: 0.94rem;
  font-style: normal;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(43, 42, 40, 0.05);
}

.article-detail__body {
  display: grid;
  gap: 24px;
  max-width: 46rem;
  margin: 0 auto;
  padding-top: 34px;
  font-family: var(--article-serif);
}

.article-detail__body > * {
  min-width: 0;
}

.article-detail__body h2,
.article-detail__body h3,
.article-detail__body h4 {
  margin: 18px 0 0;
  color: var(--ink);
  font-family: var(--article-sans);
  font-size: clamp(1.45rem, 2.3vw, 1.95rem);
  font-weight: 760;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.article-lead {
  color: var(--ink);
  font-size: 1.06rem;
}

.article-detail__body > h2:first-child + p {
  color: var(--ink);
  font-size: 1.26rem;
  line-height: 1.78;
}

.article-lead strong {
  color: var(--ink);
}

.article-detail__body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 0.18em;
}

.article-detail__body p,
.article-detail__body li {
  color: rgba(43, 42, 40, 0.84);
  font-size: 1.14rem;
  line-height: 1.92;
}

.article-detail__body ul,
.article-detail__body ol {
  display: grid;
  gap: 12px;
  padding-left: 28px;
  margin-top: -2px;
}

.article-detail__body li::marker {
  color: var(--accent);
  font-family: var(--article-code);
}

.article-code-block {
  display: grid;
  gap: 12px;
  padding: 16px 18px 18px;
  border: 1px solid rgba(232, 226, 217, 0.92);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(249, 246, 240, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.article-code-block__toolbar {
  display: flex;
  justify-content: flex-end;
}

.article-code-block__copy {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(213, 203, 189, 0.92);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  font-family: var(--article-sans);
  font-size: 0.84rem;
  font-weight: 650;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.article-code-block__copy:hover {
  color: var(--ink);
  border-color: rgba(52, 112, 184, 0.28);
}

.article-code-block__copy:active {
  transform: translateY(1px);
}

.article-code-block__copy[data-copy-state="copied"] {
  border-color: rgba(52, 112, 184, 0.82);
  background: rgba(52, 112, 184, 0.12);
  color: var(--accent);
}

.article-code-block__copy[data-copy-state="error"] {
  border-color: rgba(146, 78, 54, 0.22);
  background: rgba(146, 78, 54, 0.08);
  color: #924e36;
}

.article-detail__body pre {
  overflow-x: auto;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.article-detail__body pre code {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
  font-family: var(--article-code);
  font-size: 0.95rem;
  line-height: 1.78;
  tab-size: 2;
}

.article-image {
  width: min(100%, 46rem);
  margin: 4px 0 8px;
}

.article-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 22px 44px rgba(43, 42, 40, 0.12);
}

.search-shell {
  margin-top: 18px;
}

.search-form {
  display: grid;
  gap: 12px;
}

.search-form__label {
  font-size: 0.96rem;
  color: var(--muted);
}

.search-form__row {
  display: flex;
  gap: 10px;
}

.search-form__input {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.search-form__input:focus {
  outline: 2px solid rgba(52, 112, 184, 0.22);
  border-color: var(--accent);
}

.search-form__button {
  min-width: 74px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.search-empty {
  padding: 24px 0 0;
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer__links a {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

@media (max-width: 740px) {
  body {
    font-size: 16px;
  }

  .page-shell {
    width: min(calc(100% - 28px), var(--content-width));
    padding-top: 22px;
    padding-bottom: 48px;
  }

  .site-brand {
    font-size: 1.3rem;
  }

  .site-header__toggle {
    display: inline-flex;
  }

  .site-header__inner {
    flex-wrap: wrap;
  }

  .site-header__actions {
    margin-left: auto;
    flex-shrink: 0;
  }

  .site-nav {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 190px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .site-nav.is-open {
    display: flex;
  }

  .profile-card {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 18px;
  }

  .profile-card__avatar {
    width: 128px;
    height: 128px;
  }

  .profile-card h1 {
    font-size: clamp(1.5rem, 7.6vw, 2.1rem);
  }

  .page-intro h1,
  .article-detail__header h1 {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .search-form__row,
  .article-detail__meta-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .article-detail__body {
    gap: 20px;
  }

  .article-detail__body p,
  .article-detail__body li {
    font-size: 1.04rem;
    line-height: 1.84;
  }

  .article-detail__body > h2:first-child + p {
    font-size: 1.12rem;
  }

  .search-form__button {
    width: 100%;
  }
}
