@font-face {
  font-family: "Roboto Mono";
  src: url("assets/fonts/roboto-mono-latin-400-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --font-mono: "Roboto Mono", "Noto Sans SC", "SFMono-Regular", Consolas, monospace;
  --page: hsl(0 0% 95.3%);
  --ink: rgba(0, 0, 0, 0.82);
  --ink-strong: rgba(0, 0, 0, 0.9);
  --ink-heading: rgba(0, 0, 0, 0.8);
  --muted: rgba(0, 0, 0, 0.42);
  --faint: rgba(0, 0, 0, 0.24);
  --line: rgba(0, 0, 0, 0.06);
  --line-strong: rgba(0, 0, 0, 0.2);
  --surface: #e9e9e9;
  --focus: rgba(0, 0, 0, 0.72);
  --control-border: rgba(0, 0, 0, 0.18);
  --control-hover: rgba(0, 0, 0, 0.045);
  color-scheme: light;
}

html[data-theme="dark"] {
  --page: hsl(0 0% 10.5%);
  --ink: rgba(255, 255, 255, 0.86);
  --ink-strong: rgba(255, 255, 255, 0.94);
  --ink-heading: rgba(255, 255, 255, 0.9);
  --muted: rgba(255, 255, 255, 0.56);
  --faint: rgba(255, 255, 255, 0.34);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.28);
  --surface: #262626;
  --focus: rgba(255, 255, 255, 0.78);
  --control-border: rgba(255, 255, 255, 0.3);
  --control-hover: rgba(255, 255, 255, 0.08);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  transition: color 180ms ease, background-color 180ms ease;
}

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

.page-shell,
.site-header,
.site-search {
  width: 100%;
  padding-right: 64px;
  padding-left: 64px;
}

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 32px;
  padding-top: 32px;
  padding-bottom: 48px;
}

.brand {
  color: var(--ink-strong);
  font-size: 40px;
  font-weight: 300;
  line-height: 1.5;
  letter-spacing: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
}

.site-nav a,
.search-trigger,
.theme-toggle {
  color: var(--muted);
  transition: color 180ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.is-current,
.search-trigger:hover,
.search-trigger:focus-visible,
.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--ink);
}

.site-nav a.is-current {
  font-weight: 500;
}

.search-trigger {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: -0.125em;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
}

.theme-toggle-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  color: inherit;
  transition: color 180ms ease;
}

.theme-icon {
  display: none;
  width: 16px;
  height: 16px;
}

.theme-icon-sun { display: block; }
html[data-theme="dark"] .theme-icon-sun { display: none; }
html[data-theme="dark"] .theme-icon-moon { display: block; }

.theme-toggle-label {
  display: inline;
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.site-search {
  margin-top: -24px;
  padding-bottom: 40px;
}

.site-search[hidden] {
  display: none;
}

.site-search > label {
  display: block;
  margin-bottom: 8px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.search-row {
  display: flex;
  border-bottom: 1px solid var(--line-strong);
}

.search-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
}

.search-row button {
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.page-shell {
  padding-bottom: 48px;
}

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 48px;
}

.masthead h1 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 40px;
  font-weight: 300;
  line-height: 1.5;
}

.featured {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 32px;
  margin-bottom: 64px;
  transition: transform 260ms ease;
}

.media {
  display: block;
  margin: 0;
  overflow: hidden;
  background: var(--surface);
}

.media-featured {
  aspect-ratio: 21 / 13;
}

.media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms ease, filter 420ms ease;
}

.featured-copy {
  padding-right: 4%;
}

.eyebrow,
.meta {
  margin: 0;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.2em;
  line-height: 1.5;
  text-transform: uppercase;
}

.eyebrow {
  margin-bottom: 16px;
}

.featured h1 {
  margin: 0 0 16px;
  color: var(--ink-heading);
  font-size: 30px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
}

.summary {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.divider {
  height: 1px;
  margin-bottom: 32px;
  background: var(--line);
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 32px;
  row-gap: 32px;
}

.article-card {
  display: block;
  min-width: 0;
}

.article-card-link {
  display: block;
  transition: transform 260ms ease;
}

.card-media {
  aspect-ratio: 16 / 9;
  margin-bottom: 20px;
}

.article-card h2 {
  margin: 0 0 8px;
  color: var(--ink-heading);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: 0;
}

.article-card .summary {
  min-height: 48px;
}

.featured h1,
.article-card h2 {
  transition: color 180ms ease;
}

.featured:hover h1,
.featured:focus-visible h1,
.article-card-link:hover h2,
.article-card-link:focus-visible h2 {
  color: var(--ink-strong);
}

.featured:hover,
.featured:focus-visible {
  transform: scale(0.992);
}

.article-card-link:hover,
.article-card-link:focus-visible {
  transform: scale(0.985);
}

.article-link:hover img,
.article-link:focus-visible img {
  transform: scale(1.015);
  filter: contrast(1.035);
}

.article-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 8px;
}

.crop-1 img {
  object-position: 50% 66%;
}

.crop-2 img {
  object-position: 72% 50%;
}

.crop-3 img {
  object-position: 24% 50%;
}

.section-heading {
  max-width: 880px;
  margin-bottom: 48px;
}

.section-heading h1,
.empty-state h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 400;
  line-height: 1.25;
}

.pagination {
  margin-top: 56px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.pagination ol,
.pagination ul,
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-left: 0;
  list-style: none;
}

.pagination a,
.pagination span {
  display: inline-flex;
  min-width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid var(--line);
}

.pagination .current a,
.pagination a:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.empty-state {
  min-height: 48vh;
  padding-top: 12vh;
  text-align: center;
}

.empty-state p:not(.eyebrow) {
  color: var(--muted);
}

.text-link {
  display: inline-block;
  margin-top: 16px;
  border-bottom: 1px solid var(--faint);
}

.post-shell {
  width: min(100% - 48px, 920px);
  margin: 0 auto;
  padding-bottom: 64px;
}

.post-header {
  max-width: 760px;
  margin: 8px auto 48px;
  text-align: center;
}

.post-header h1 {
  margin: 12px 0 20px;
  font-size: 44px;
  font-weight: 500;
  line-height: 1.16;
}

.post-deck {
  margin: 0 auto 20px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.post-cover {
  aspect-ratio: 21 / 10;
  margin: 0 0 56px;
  overflow: hidden;
  background: var(--surface);
}

.post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-content {
  max-width: 720px;
  margin: 0 auto;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.85;
}

.post-content h2,
.post-content h3 {
  margin: 2em 0 0.7em;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.35;
}

.post-content h2 { font-size: 28px; }
.post-content h3 { font-size: 22px; }
.post-content p { margin: 0 0 1.35em; }
.post-content a { border-bottom: 1px solid var(--faint); }
.post-content img { max-width: 100%; height: auto; }
.post-content figure { margin: 2em 0; }
.post-content blockquote {
  margin: 2em 0;
  padding-left: 24px;
  border-left: 2px solid var(--line-strong);
  color: var(--muted);
}
.post-content pre {
  overflow-x: auto;
  padding: 20px;
  color: #e8e8e8;
  background: #202020;
  font: 14px/1.65 var(--font-mono);
}
.post-content code { font-family: var(--font-mono); }
.post-content :not(pre) > code { padding: 0.15em 0.35em; background: var(--control-hover); }
.post-content table { width: 100%; border-collapse: collapse; }
.post-content th,
.post-content td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; }

.post-footer,
.comments-area {
  max-width: 720px;
  margin-right: auto;
  margin-left: auto;
}

.post-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.post-tags a {
  display: inline-block;
  margin: 0 8px 8px 0;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font: 11px var(--font-mono);
}

.post-near {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 32px;
}

.post-near-item {
  position: relative;
  display: flex;
  width: min(48%, 320px);
  min-height: 64px;
  flex-direction: column;
  justify-content: center;
  padding: 10px 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  transition: color 180ms ease, transform 180ms ease;
}

.post-near-label {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0;
  transition: color 180ms ease;
}

.post-near-label .icon {
  font-size: 12px;
}

.post-near-item-next {
  align-items: flex-end;
  margin-left: auto;
  text-align: right;
}

.post-near-link {
  overflow-wrap: anywhere;
}

/* Keep the label and surrounding space inside the navigation link's hit area. */
.post-near-link::after {
  position: absolute;
  inset: 0;
  content: "";
}

.post-near-item:hover,
.post-near-item:focus-within {
  color: var(--ink);
}

.post-near-item:hover .post-near-label,
.post-near-item:focus-within .post-near-label {
  color: var(--muted);
}

.post-near-item-prev:hover,
.post-near-item-prev:focus-within {
  transform: translateX(-3px);
}

.post-near-item-next:hover,
.post-near-item-next:focus-within {
  transform: translateX(3px);
}

.post-near-link:focus-visible {
  outline: none;
}

.post-near-link:focus-visible::after {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.comments-area {
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}

.comments-area h2 {
  margin: 0 0 24px;
  font-size: 20px;
  font-weight: 500;
}

.comment-list,
.comment-list ol {
  padding-left: 0;
  list-style: none;
}

.comment-list ol { margin-left: 32px; }
.comment-body { margin-bottom: 28px; }
.comment-author { font-weight: 500; }
.comment-meta { color: var(--faint); font: 11px var(--font-mono); }
.comment-content { color: var(--muted); }
.comment-reply { font-size: 13px; }
.respond { margin-top: 48px; }
.comment-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.respond label {
  display: block;
  margin-bottom: 6px;
  color: var(--faint);
  font: 11px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.respond input,
.respond textarea {
  width: 100%;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--control-border);
  border-radius: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
}
.respond textarea { resize: vertical; }
.respond input:focus,
.respond textarea:focus { border-color: var(--focus); }
.submit-button {
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid var(--control-border);
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  transition: color 180ms ease, background-color 180ms ease,
    border-color 180ms ease, transform 180ms ease;
}

.submit-button:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--control-hover);
  transform: scale(0.98);
}

.submit-button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.submit-button:active {
  background: var(--line);
  transform: scale(0.96);
}

.submit-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin: 16px 64px 0;
  padding: 24px 0 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: none;
}

.site-footer.has-icp {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.site-footer.has-icp > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.site-footer.has-icp .footer-note {
  text-align: right;
}

.footer-icp {
  text-align: center;
  transition: color 180ms ease;
}

.footer-icp:hover,
.footer-icp:active {
  color: var(--ink);
}

.footer-icp:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  padding: 10px 14px;
  color: #f7f7f7;
  background: rgba(0, 0, 0, 0.84);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1023px) {
  .page-shell,
  .site-header,
  .site-search {
    padding-right: 32px;
    padding-left: 32px;
  }

  .featured {
    grid-template-columns: 1fr;
  }

  .featured-copy {
    padding-right: 0;
  }

  .article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer {
    margin-right: 32px;
    margin-left: 32px;
  }
}

@media (max-width: 639px) {
  .page-shell {
    padding: 0 24px 40px;
  }

  .site-header {
    align-items: flex-start;
    padding: 24px 24px 36px;
  }

  .brand {
    font-size: 36px;
  }

  .masthead h1 {
    font-size: 36px;
  }

  .site-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px 16px;
    padding-top: 17px;
  }

  .site-search {
    padding-right: 24px;
    padding-left: 24px;
  }

  .featured {
    gap: 24px;
    margin-bottom: 48px;
  }

  .media-featured {
    aspect-ratio: 4 / 3;
  }

  .featured h1 {
    font-size: 24px;
    line-height: 1.35;
  }

  .article-grid {
    grid-template-columns: 1fr;
    row-gap: 44px;
  }

  .article-card .summary {
    min-height: 0;
  }

  .site-footer {
    flex-direction: column;
    margin: 8px 24px 0;
  }

  .site-footer.has-icp {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
  }

  .site-footer.has-icp .footer-note {
    text-align: center;
  }

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

  .post-deck {
    font-size: 16px;
  }

  .post-cover {
    aspect-ratio: 4 / 3;
    margin-bottom: 40px;
  }

  .comment-fields {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

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

  .media img {
    transition: none;
  }

  .featured,
  .article-card-link,
  .post-near-item,
  .footer-icp,
  .submit-button {
    transition: none;
  }
}
