:root {
  --bg: #c7edcc;
  --surface: #c7edcc;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --code: #111827;
  --shell: min(1080px, calc(100vw - 48px));
  --reading: min(720px, calc(100vw - 48px));
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration-color: #94a3b8;
  text-underline-offset: 0.2em;
}

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

a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.25);
  outline-offset: 3px;
}

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 9px 13px;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: var(--bg);
  backdrop-filter: blur(14px);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand-mark {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 3px;
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.nav {
  display: flex;
  gap: clamp(18px, 3vw, 34px);
  font-size: 14px;
}

.nav a {
  position: relative;
  padding: 24px 0 22px;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

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

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

.nav a:hover::after,
.nav a.active::after {
  transform: scaleX(1);
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.page-head h1,
.article-head h1,
.not-found h1 {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0;
  font-size: clamp(50px, 7.2vw, 80px);
  font-weight: 760;
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease,
    background-color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}

.button.primary:hover {
  color: #fff;
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.page-head {
  padding: 96px 0 72px;
  border-bottom: 1px solid var(--line);
}

.page-head h1,
.article-head h1,
.not-found h1 {
  font-size: clamp(46px, 7vw, 72px);
}

.page-head > p:last-child {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.archive {
  padding: 32px 0 112px;
}

.archive-item {
  display: grid;
  grid-template-columns: 120px 1fr 32px;
  gap: 28px;
  align-items: start;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

.archive-item time {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
}

.archive-item h2 {
  margin: -5px 0 7px;
  font-size: 27px;
  letter-spacing: -0.02em;
}

.archive-item h2 a {
  text-decoration: none;
}

.archive-item p {
  margin: 0;
  color: var(--muted);
}

.archive-arrow {
  color: var(--muted);
  font-size: 22px;
  text-decoration: none;
}

.article {
  width: var(--reading);
  padding: 94px 0 120px;
}

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

.article-deck {
  max-width: 650px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 20px;
}

.prose {
  padding-top: 42px;
  font-size: 17px;
}

.plain-article .prose {
  padding-top: 0;
}

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

.prose h1 {
  margin: 0 0 1.2em;
  font-size: clamp(30px, 5vw, 42px);
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.prose h2,
.prose h3 {
  margin: 2.3em 0 0.8em;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote {
  margin: 1.25em 0;
}

.prose li + li {
  margin-top: 0.45em;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.prose code {
  padding: 0.16em 0.38em;
  border-radius: 5px;
  background: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.9em;
}

.prose pre {
  overflow: auto;
  padding: 22px;
  color: #e5e7eb;
  background: var(--code);
  border-radius: 12px;
}

.prose pre code {
  padding: 0;
  color: inherit;
  background: none;
}

.prose blockquote {
  margin-left: 0;
  padding: 2px 0 2px 20px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

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

.prose table {
  width: 100%;
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
}

.prose th,
.prose td {
  min-width: 92px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.back-to-list {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  margin-top: 56px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.not-found {
  min-height: 620px;
  padding: 110px 0;
}

.not-found > p:not(.eyebrow) {
  margin: 26px 0;
  color: var(--muted);
}

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

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

.footer-inner a {
  color: inherit;
}

.simple-index {
  width: min(680px, calc(100vw - 40px));
  margin-inline: auto;
  padding: clamp(72px, 12vw, 140px) 0;
}

.simple-posts {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.simple-posts li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.simple-posts a {
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
}

.simple-posts time {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.simple-posts .empty {
  display: block;
  color: var(--muted);
}

@media (max-width: 760px) {
  :root {
    --shell: min(100% - 32px, 1080px);
    --reading: min(100% - 32px, 720px);
  }

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

  .brand {
    font-size: 14px;
  }

  .brand-mark {
    width: 8px;
    height: 8px;
    box-shadow: 0 0 0 4px var(--accent-soft);
  }

  .nav {
    gap: 17px;
    font-size: 13px;
  }

  .nav a {
    padding: 21px 0 19px;
  }

  .nav a::after {
    bottom: 12px;
  }

  .archive-item {
    grid-template-columns: 1fr 28px;
    gap: 10px;
  }

  .archive-item time {
    grid-column: 1 / -1;
  }

  .article,
  .page-head {
    padding-top: 68px;
  }

  .prose {
    padding-top: 36px;
    font-size: 16.5px;
  }

  .footer-inner {
    min-height: 104px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
  }

  .footer-inner p {
    margin: 0;
  }
}

@media (max-width: 460px) {
  .brand > span:last-child {
    display: none;
  }

  .button {
    width: 100%;
  }

  .simple-posts li {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

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

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