:root {
  color-scheme: light;
  --font-body: "Source Serif 4", "Noto Serif SC", "Source Han Serif SC",
    "Songti SC", STSong, serif;
  --font-display: "Source Serif 4", "Noto Serif SC", "Source Han Serif SC",
    "Songti SC", STSong, serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono",
    monospace;
  --ink: #20212b;
  --ink-soft: #353744;
  --muted: #6f7180;
  --faint: #9698a4;
  --accent: #6268d9;
  --accent-deep: #464cba;
  --accent-soft: rgba(98, 104, 217, 0.11);
  --line: rgba(40, 42, 56, 0.12);
  --line-strong: rgba(40, 42, 56, 0.2);
  --canvas: #f6f5f2;
  --paper: rgba(255, 255, 255, 0.72);
  --paper-solid: #fcfcfb;
  --paper-hover: rgba(255, 255, 255, 0.88);
  --code: rgba(246, 246, 249, 0.88);
  --shadow-soft: 0 14px 42px rgba(48, 49, 72, 0.07);
  --shadow-lifted: 0 24px 70px rgba(48, 49, 72, 0.12);
  --pointer-x: 72vw;
  --pointer-y: 20vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.78;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: transparent;
  color: var(--ink);
  letter-spacing: 0.006em;
  isolation: isolate;
}

::selection {
  background: rgba(98, 104, 217, 0.2);
  color: var(--ink);
}

.ambient-background {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(246, 245, 242, 0.55)),
    var(--canvas);
}

.ambient-background::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(55, 58, 82, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(55, 58, 82, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  content: "";
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.82), transparent 84%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.82), transparent 84%);
  opacity: 0.72;
}

.ambient-background::after {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 0, rgba(246, 245, 242, 0.3) 74%);
  content: "";
}

.ambient-glow {
  position: absolute;
  display: block;
  border-radius: 999px;
  will-change: transform;
}

.ambient-glow--pointer {
  width: min(62vw, 760px);
  aspect-ratio: 1;
  left: 0;
  top: 0;
  background: radial-gradient(
    circle,
    rgba(126, 132, 235, 0.22) 0,
    rgba(143, 205, 231, 0.12) 36%,
    transparent 70%
  );
  opacity: 0.7;
  transform: translate3d(calc(var(--pointer-x) - 50%), calc(var(--pointer-y) - 50%), 0);
  transition: opacity 280ms ease;
}

.pointer-active .ambient-glow--pointer {
  opacity: 0.92;
}

.ambient-glow--blue {
  width: 520px;
  height: 520px;
  left: -210px;
  top: 28%;
  background: radial-gradient(circle, rgba(123, 211, 224, 0.16), transparent 68%);
  animation: drift-blue 22s ease-in-out infinite;
}

.ambient-glow--warm {
  width: 480px;
  height: 480px;
  right: -180px;
  bottom: -120px;
  background: radial-gradient(circle, rgba(239, 176, 143, 0.15), transparent 68%);
  animation: drift-warm 26s ease-in-out infinite;
}

@keyframes drift-blue {
  0%,
  100% {
    transform: translate3d(0, -20px, 0) scale(1);
  }

  50% {
    transform: translate3d(70px, 70px, 0) scale(1.08);
  }
}

@keyframes drift-warm {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(-80px, -55px, 0) scale(1.1);
  }
}

a {
  color: inherit;
  text-decoration-color: rgba(70, 76, 186, 0.42);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:hover {
  text-decoration-color: currentColor;
}

a:focus-visible {
  border-radius: 3px;
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.container {
  width: min(100% - 48px, 820px);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(40, 42, 56, 0.09);
  background: rgba(248, 247, 244, 0.72);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  backdrop-filter: blur(18px) saturate(145%);
}

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

.site-title {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-decoration: none;
}

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

.site-nav a {
  padding: 0.36rem 0.68rem;
  border-radius: 999px;
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease;
}

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

main.container {
  min-height: calc(100vh - 170px);
  padding-block: 76px 108px;
}

.page-header h1,
.post-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.35rem, 7vw, 4rem);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.045em;
}

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

.post-list-item {
  position: relative;
  padding: 25px 28px 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.post-list-item::before {
  position: absolute;
  width: 3px;
  height: 34px;
  top: 25px;
  left: -1px;
  border-radius: 0 99px 99px 0;
  background: linear-gradient(var(--accent), #78cbd8);
  content: "";
  opacity: 0;
  transform: scaleY(0.65);
  transition: opacity 180ms ease, transform 180ms ease;
}

.post-list-item time,
.post-header time,
.archive-list time {
  color: var(--faint);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  font-weight: 620;
  letter-spacing: 0.06em;
}

.post-list-item h2 {
  margin: 7px 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.34rem, 3vw, 1.58rem);
  line-height: 1.38;
  letter-spacing: -0.02em;
}

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

.post-list-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.72;
}

@media (hover: hover) {
  .post-list-item:hover {
    border-color: rgba(98, 104, 217, 0.27);
    background: var(--paper-hover);
    box-shadow: var(--shadow-lifted);
    transform: translateY(-3px);
  }

  .post-list-item:hover::before {
    opacity: 1;
    transform: scaleY(1);
  }
}

.post,
.page {
  padding: clamp(28px, 6.5vw, 58px);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: var(--shadow-lifted);
}

.page-header,
.post-header {
  margin-bottom: 50px;
}

.post-header time {
  display: block;
  margin-bottom: 13px;
}

.post-content {
  color: var(--ink-soft);
  font-size: 1.01rem;
  line-height: 1.88;
  overflow-wrap: anywhere;
}

.post-content h2,
.post-content h3,
.post-content h4 {
  margin: 2.25em 0 0.76em;
  color: var(--ink);
  font-family: var(--font-display);
  line-height: 1.42;
  letter-spacing: -0.018em;
}

.post-content h2 {
  font-size: 1.58rem;
}

.post-content h3 {
  font-size: 1.28rem;
}

.post-content p,
.post-content ul,
.post-content ol,
.post-content blockquote,
.post-content pre,
.post-content table {
  margin-block: 1.28em;
}

.post-content a {
  color: var(--accent-deep);
  font-weight: 520;
}

.post-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2.1em auto;
  border-radius: 13px;
  box-shadow: 0 16px 46px rgba(39, 41, 58, 0.13);
}

.post-content blockquote {
  margin-inline: 0;
  padding: 0.75em 1.2em;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  color: #5c5f6e;
}

.post-content code {
  padding: 0.14em 0.38em;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--code);
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.post-content pre,
.post-content .highlight {
  overflow-x: auto;
  padding: 19px 21px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(246, 246, 249, 0.9);
  box-shadow: 0 9px 28px rgba(46, 48, 68, 0.06) inset;
  line-height: 1.68;
}

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

.post-content .highlight table,
.post-content .highlight pre {
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.post-content table {
  width: 100%;
  border-collapse: separate;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  border-spacing: 0;
  font-size: 0.92rem;
  overflow: hidden;
}

.post-content th,
.post-content td {
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.post-content th {
  background: rgba(98, 104, 217, 0.07);
  color: var(--ink);
}

.post-content th:last-child,
.post-content td:last-child {
  border-right: 0;
}

.post-content tr:last-child td {
  border-bottom: 0;
}

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

.post-taxonomy {
  margin-top: 58px;
  padding-top: 23px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}

.post-taxonomy div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.post-taxonomy div + div {
  margin-top: 10px;
}

.post-taxonomy span {
  display: inline-block;
  min-width: 42px;
  color: var(--ink);
  font-weight: 650;
}

.post-taxonomy a {
  padding: 2px 8px;
  border: 1px solid rgba(98, 104, 217, 0.15);
  border-radius: 999px;
  background: rgba(98, 104, 217, 0.06);
  text-decoration: none;
}

.page-header + .archive-list {
  margin-top: -18px;
}

.archive-list {
  padding: clamp(23px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.archive-list h2 {
  margin: 35px 0 8px;
  color: var(--accent-deep);
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.archive-list h2:first-child {
  margin-top: 0;
}

.archive-list article {
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.archive-list article a {
  text-decoration: none;
  transition: color 150ms ease, transform 150ms ease;
}

.archive-list article a:hover {
  color: var(--accent-deep);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 42px;
}

.pagination a,
.pagination span {
  min-width: 38px;
  padding: 6px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  text-align: center;
  text-decoration: none;
}

.pagination a:hover {
  border-color: rgba(98, 104, 217, 0.35);
  background: var(--paper-hover);
}

.pagination .current {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.post-navigation {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.post-navigation a {
  min-height: 88px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.post-navigation a:hover {
  border-color: rgba(98, 104, 217, 0.35);
  background: var(--paper-hover);
}

.post-navigation a:last-child {
  text-align: right;
}

.post-navigation span {
  display: block;
  margin-bottom: 5px;
  color: var(--faint);
  font-size: 0.74rem;
  font-weight: 620;
  letter-spacing: 0.08em;
}

.post-navigation strong {
  font-family: var(--font-display);
  font-size: 0.96rem;
}

.site-footer {
  border-top: 1px solid rgba(40, 42, 56, 0.09);
  background: rgba(248, 247, 244, 0.52);
  color: var(--muted);
  font-size: 0.8rem;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.site-footer .container {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 28px, 820px);
  }

  .ambient-background::before {
    background-size: 36px 36px;
    opacity: 0.52;
  }

  .ambient-glow--pointer {
    width: 520px;
  }

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

  .site-title {
    font-size: 1.12rem;
  }

  .site-nav {
    gap: 0;
    font-size: 0.82rem;
  }

  .site-nav a {
    padding-inline: 0.48rem;
  }

  main.container {
    padding-block: 45px 72px;
  }

  .page-header h1,
  .post-header h1 {
    font-size: clamp(2rem, 11vw, 2.8rem);
  }

  .post-list-item {
    padding: 22px 20px 24px;
    border-radius: 15px;
  }

  .post-list-item::before {
    top: 22px;
  }

  .post,
  .page {
    padding: 27px 20px 33px;
    border-radius: 20px;
  }

  .page-header,
  .post-header {
    margin-bottom: 36px;
  }

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

  .post-content pre,
  .post-content .highlight {
    margin-inline: -8px;
    padding: 17px 15px;
  }

  .archive-list {
    padding: 22px 19px;
    border-radius: 17px;
  }

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

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

  .post-navigation a:last-child {
    text-align: left;
  }
}

@media (max-width: 390px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    padding-block: 11px;
  }

  .site-nav {
    margin-left: -0.48rem;
  }
}

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

  .ambient-glow {
    animation: none;
  }

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

@media print {
  :root,
  body {
    background: #fff;
  }

  .ambient-background,
  .site-header,
  .site-footer,
  .pagination,
  .post-navigation {
    display: none;
  }

  main.container {
    width: 100%;
    padding: 0;
  }

  .post,
  .page {
    padding: 0;
    border: 0;
    box-shadow: none;
  }
}
