:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #666f78;
  --paper: #fbfaf8;
  --line: #e1ded8;
  --accent: #106b63;
  --accent-soft: #e7f1ef;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.17em;
}

.page {
  margin: 0 auto;
  max-width: 780px;
  padding: 34px 22px 64px;
}

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

.topline {
  align-items: baseline;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0;
}

h1 {
  font-size: 2.25rem;
  font-weight: 760;
  letter-spacing: 0;
}

.site-title {
  color: var(--ink);
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

nav a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 650;
  text-decoration: none;
}

nav a:hover,
.post-title a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.intro {
  color: #333b42;
  margin: 14px 0 0;
  max-width: 680px;
}

.contact {
  color: var(--muted);
  font-size: 0.96rem;
  margin: 10px 0 0;
}

main {
  display: grid;
  gap: 44px;
}

section {
  scroll-margin-top: 24px;
}

.section-title {
  font-size: 1.15rem;
  margin-bottom: 14px;
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-item {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  grid-template-columns: 118px minmax(0, 1fr);
  padding: 16px 0;
}

.post-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.post-date {
  color: var(--muted);
  font-size: 0.94rem;
  white-space: nowrap;
}

.post-title {
  font-size: 1.12rem;
  font-weight: 730;
  line-height: 1.3;
}

.post-title a {
  color: var(--ink);
  text-decoration: none;
}

.post-summary {
  color: var(--muted);
  margin: 5px 0 0;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag {
  background: var(--accent-soft);
  border-radius: 999px;
  color: #27564f;
  font-size: 0.82rem;
  font-weight: 680;
  line-height: 1;
  padding: 6px 9px;
}

.post h2 {
  font-size: 1.85rem;
  margin-bottom: 10px;
}

.post-body {
  margin-top: 24px;
}

.post-body h2 {
  font-size: 1.45rem;
  margin: 30px 0 10px;
}

.post-body h3 {
  font-size: 1.18rem;
  margin: 24px 0 8px;
}

.post-body h4 {
  font-size: 1.02rem;
  margin: 20px 0 8px;
}

.post-body p {
  margin: 13px 0;
}

.post-body blockquote {
  border-left: 3px solid var(--line);
  color: #2f3940;
  margin: 18px 0;
  padding: 2px 0 2px 16px;
}

.post-body blockquote p {
  margin: 8px 0;
}

.post-body ul,
.post-body ol {
  margin: 12px 0;
  padding-left: 24px;
}

.post-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 28px 0;
}

.post-body code,
.publish code {
  background: #eeeae3;
  border-radius: 5px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
  padding: 0.08rem 0.28rem;
}

.post-body pre {
  background: #f1eee8;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  padding: 14px;
}

.post-body pre code {
  background: transparent;
  padding: 0;
}

.math-block,
mjx-container[display="true"] {
  margin: 18px 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.video-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin: 18px 0;
}

.video-grid video,
.video-grid iframe,
.video-grid img {
  background: #000;
  border-radius: 8px;
  display: block;
  width: 100%;
}

.post-nav {
  border-top: 1px solid var(--line);
  margin-top: 32px;
  padding-top: 18px;
}

.small-list {
  color: var(--muted);
  margin: 0;
  padding-left: 20px;
}

.small-list li {
  margin: 7px 0;
}

.publish {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding-top: 28px;
}

.publish h2 {
  color: var(--ink);
  font-size: 1.15rem;
  margin-bottom: 10px;
}

footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.94rem;
  margin-top: 48px;
  padding-top: 18px;
}

.empty {
  color: var(--muted);
}

@media (max-width: 640px) {
  .page {
    padding: 24px 18px 48px;
  }

  .topline {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  nav {
    justify-content: flex-start;
  }

  h1 {
    font-size: 1.95rem;
  }

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

  .post-date {
    white-space: normal;
  }
}
