:root {
  --bg: #ffffff;
  --bg-soft: #f6f6f7;
  --text-1: #3c3c43;
  --text-2: #67676c;
  --faint: #6b6b70;
  --line: #e2e2e3;
  --brand: #3451b2;
  --gray-1: #8c8c91;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1b1f;
    --bg-soft: #202127;
    --text-1: #dfdfd6;
    --text-2: #98989f;
    --faint: #9b9ba3;
    --line: #2e2e32;
    --brand: #a8b1ff;
    --gray-1: #5c5f66;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body.site {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text-1);
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", system-ui, sans-serif;
  -webkit-font-smoothing: auto;
}

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

.nav-wrap {
  display: flex;
  justify-content: center;
  padding: 56px 20px 0;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  padding: 3px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 1px 2px #00000008, 0 2px 8px #00000008;
  font-size: 13px;
}

.nav a {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-weight: 500;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s;
}

.nav a:hover,
.nav a.active {
  background: var(--bg-soft);
  color: var(--text-1);
}

.site-main {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 20px 96px;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.intro {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.identity {
  display: flex;
  align-items: center;
  gap: 18px;
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.name {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.role {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-2);
}

.bio {
  margin: 0;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-1);
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
}

.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-1);
  font-weight: 500;
  transition: color 0.15s, border-color 0.15s;
}

.chip:hover {
  color: var(--brand);
}

.section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.4;
  color: var(--faint);
}

.more {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  font-size: 13px;
  color: var(--faint);
}

.more:hover {
  color: var(--brand);
}

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

.posts li {
  border-top: 1px solid var(--line);
}

.post-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  min-height: 44px;
  padding: 14px 0;
}

.post-title {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
  transition: color 0.15s;
}

.post-link:hover .post-title {
  color: var(--brand);
}

.post-date {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  color: var(--faint);
  white-space: nowrap;
  flex-shrink: 0;
}

.works {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.work {
  display: flex;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color 0.15s;
}

.work:hover {
  border-color: var(--gray-1);
}

.work-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.work-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--bg-soft);
}

.work-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.work-name {
  font-size: 15px;
  font-weight: 600;
}

.work-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2);
}

.work-go {
  color: var(--faint);
  flex-shrink: 0;
  transition: color 0.15s;
}

.work:hover .work-go {
  color: var(--brand);
}

.site-page-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.article-title {
  margin: 0;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.005em;
}

.post-head {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-2);
}

.meta time {
  font-size: 13px;
}

.meta-author {
  font-weight: 500;
  color: var(--text-1);
}

.rule {
  height: 1px;
  background: var(--line);
}

.prose {
  font-size: 17px;
  line-height: 1.9;
  color: var(--text-1);
}

.prose p {
  margin: 0 0 20px;
}

.prose h2 {
  margin: 48px 0 16px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
}

.prose h3 {
  margin: 32px 0 12px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
}

.prose ul,
.prose ol {
  margin: 0 0 20px;
  padding-left: 22px;
}

.prose li {
  margin: 6px 0;
  padding-left: 4px;
}

.prose li::marker {
  color: var(--faint);
}

.prose a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
}

.prose a:hover {
  color: var(--brand);
  text-decoration-color: var(--brand);
}

.prose blockquote {
  margin: 0 0 20px;
  padding: 4px 0 4px 16px;
  border-left: 2px solid var(--line);
  color: var(--text-2);
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 28px auto;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.prose :not(pre) > code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg-soft);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.85em;
}

.prose pre {
  margin: 0 0 20px;
  padding: 16px 20px;
  overflow-x: auto;
  border-radius: 12px;
  background: var(--bg-soft);
  font-size: 13px;
  line-height: 1.7;
}

.prose pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}

.site-page-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.site-page-lead {
  margin: 0;
  font-size: 16px;
  line-height: 1.8;
}

.page-meta,
.year-date,
.work-card-sub {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.page-meta {
  font-size: 13px;
  color: var(--faint);
}

.year {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.year-head {
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
}

.year-count {
  font-size: 13px;
  font-weight: 400;
  color: var(--faint);
}

.year-posts li {
  border-top: 1px solid var(--line);
}

.year-link {
  justify-content: flex-start;
  gap: 20px;
}

.year-link .post-title {
  min-width: 0;
}

.year-date {
  width: 44px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--faint);
}

.meta-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  object-fit: cover;
}

.dot {
  color: var(--faint);
}

.post-page {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.work-cards {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.work-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.work-card-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.work-card-logo,
.work-card-mark {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.work-card-logo {
  object-fit: cover;
}

.work-card-mark {
  display: grid;
  place-items: center;
  background: var(--bg-soft);
  font-weight: 700;
}

.work-card-name {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
}

.work-card-sub {
  font-size: 13px;
  color: var(--faint);
}

.work-card-desc {
  margin: 0;
  font-size: 16px;
  line-height: 1.8;
}

.site .cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--text-1);
  color: var(--bg);
  font-size: 14px;
  font-weight: 500;
}

.site .cta:hover {
  opacity: 0.85;
  color: var(--bg);
}

.about-intro {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.about-identity {
  display: flex;
  align-items: center;
  gap: 20px;
}

.about-avatar {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  object-fit: cover;
}

.about-bio p {
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 1.85;
}

.about-bio p:last-child {
  margin-bottom: 0;
}

.site-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.now li {
  border-top: 1px solid var(--line);
}

.now li:last-child {
  border-bottom: 1px solid var(--line);
}

.now-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
}

.now-logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid var(--line);
  object-fit: cover;
}

.now-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.now-name {
  font-size: 15px;
  font-weight: 600;
}

.now-desc {
  font-size: 14px;
  color: var(--text-2);
}

.prose h2,
.prose h3 {
  scroll-margin-top: 24px;
}

.toc {
  display: none;
}

.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc a {
  position: relative;
  display: block;
  padding: 3px 0 3px 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--faint);
}

.toc ul ul a {
  padding-left: 26px;
}

.toc a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 1px;
  background: currentColor;
  opacity: 0;
}

.toc a:hover {
  color: var(--text-2);
}

.toc li.active > a {
  color: var(--text-1);
}

.toc li.active > a::before {
  width: 8px;
  opacity: 1;
}

.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-2);
  box-shadow: 0 1px 2px #0000000a, 0 4px 12px #0000000f;
  cursor: pointer;
}

.to-top:hover {
  color: var(--text-1);
  border-color: var(--gray-1);
}

@media (min-width: 1200px) {
  .toc {
    position: fixed;
    top: 120px;
    left: calc(50% + 360px);
    width: 180px;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    display: block;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  }

  .toc.shown {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .to-top.beside-toc {
    right: auto;
    left: calc(50% + 360px);
    bottom: 32px;
  }
}

@media (max-width: 560px) {
  .to-top {
    right: 16px;
    bottom: 16px;
  }
}

.license {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--faint);
}

.site-footer {
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--faint);
  text-align: center;
}

.empty {
  margin: 0;
  color: var(--faint);
}

.top-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  width: 100%;
  height: 3px;
  pointer-events: none;
  opacity: 0;
}

.top-progress.is-on {
  opacity: 1;
}

.top-progress.is-done {
  opacity: 0;
  transition: opacity 0.4s ease 0.15s;
}

.top-progress-bar {
  height: 100%;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.28s ease-out;
}

@media (max-width: 560px) {
  .nav-wrap {
    padding: 24px 16px 0;
  }

  .site-main {
    padding: 36px 16px 80px;
    gap: 48px;
  }

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

  .article-title {
    font-size: 28px;
  }

  .prose {
    font-size: 16px;
    line-height: 1.85;
  }

  .prose h2 {
    font-size: 20px;
  }

  .year-link {
    align-items: flex-start;
    gap: 12px;
  }

  .post-title {
    overflow-wrap: anywhere;
  }
}
