:root {
  --blue: #47a7d8;
  --blue-dark: #1677a6;
  --blue-soft: #eef8fd;
  --ink: #27323a;
  --muted: #667580;
  --line: #d8edf7;
  --page: #fbfeff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #eef9ff 0, rgba(238, 249, 255, 0) 260px),
    var(--page);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.68;
}

a {
  color: var(--blue-dark);
  text-decoration-color: rgba(71, 167, 216, 0.35);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: #0c5e86;
  text-decoration-color: currentColor;
}

.page {
  width: min(920px, calc(100% - 40px));
  margin: 0 auto;
  padding: 54px 0 36px;
}

.intro {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 34px;
  align-items: center;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line);
}

.avatar {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border: 4px solid #fff;
  border-radius: 50%;
  box-shadow: 0 10px 28px rgba(22, 119, 166, 0.14);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: 2.6rem;
  line-height: 1.12;
  letter-spacing: 0;
}

h1 span {
  color: var(--blue-dark);
  font-weight: 650;
}

h2 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--blue-dark);
  font-size: 1.26rem;
  line-height: 1.25;
  letter-spacing: 0;
}

h2::before {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--blue);
  border-radius: 50%;
  content: "";
}

.role {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 1.05rem;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.links a {
  padding: 5px 11px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 650;
  text-decoration: none;
}

.links a:hover {
  background: var(--blue-soft);
}

.topbar {
  display: flex;
  gap: 14px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.topbar a {
  padding: 5px 11px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 650;
  text-decoration: none;
}

.section {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.section p:last-child,
.entry p:last-child {
  margin-bottom: 0;
}

.zh,
.note {
  color: var(--muted);
}

.note {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--blue-soft);
  border-left: 3px solid var(--blue);
  border-radius: 0 8px 8px 0;
}

.entry {
  margin-top: 10px;
}

.entry + .entry {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px dashed var(--line);
}

.entry-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 8px;
}

.entry-head strong {
  color: var(--ink);
}

.entry-head span,
.date {
  color: var(--muted);
  font-size: 0.94rem;
  white-space: nowrap;
}

.list,
.projects {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.list li {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
}

.projects li {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
}

.projects a,
.projects strong {
  color: var(--ink);
  font-weight: 700;
}

.projects span {
  color: var(--muted);
}

.blog-index-header,
.article-header {
  padding: 40px 0 28px;
  border-bottom: 1px solid var(--line);
}

.blog-index-header h1,
.article-header h1 {
  margin-bottom: 10px;
  color: var(--blue-dark);
}

.blog-index-header p,
.article-subtitle,
.article-meta {
  color: var(--muted);
}

.article-meta {
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 650;
}

.blog-list {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.blog-list li {
  padding: 18px 0;
  border-bottom: 1px dashed var(--line);
}

.blog-list li:last-child {
  border-bottom: 0;
}

.blog-list a {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 1.1rem;
  font-weight: 750;
}

.blog-list span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.blog-list p {
  margin-bottom: 0;
  color: var(--muted);
}

.blog-list.compact li {
  padding: 14px 0;
}

.series-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding-top: 8px;
}

.series-card {
  padding: 20px 0;
  border-top: 2px solid var(--blue);
}

.series-card h2 {
  margin-bottom: 8px;
}

.series-card h2::before {
  display: none;
}

.series-card p {
  margin-bottom: 14px;
  color: var(--muted);
}

.series-link {
  font-weight: 700;
  text-decoration: none;
}

.article-shell {
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr);
  gap: 42px;
  padding-top: 28px;
}

.toc {
  align-self: start;
  position: sticky;
  top: 22px;
  display: grid;
  gap: 4px;
  padding: 2px 0 0;
}

.toc-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toc a {
  padding: 3px 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
  text-decoration: none;
}

.toc a:hover {
  color: var(--blue-dark);
}

.toc nav {
  width: 100%;
}

.toc ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc ul ul {
  margin-top: 2px;
  padding-left: 12px;
}

.article-body {
  min-width: 0;
}

.article-body h1 {
  display: none;
}

.article-body h2 {
  display: block;
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 1.42rem;
}

.article-body h2::before {
  margin-right: 10px;
  vertical-align: middle;
}

.article-body h3 {
  margin-top: 26px;
  color: var(--ink);
}

.article-body p,
.article-body li {
  color: var(--ink);
}

.article-body code {
  padding: 0.08em 0.32em;
  background: var(--blue-soft);
  border-radius: 5px;
  color: #0d5e82;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 0.93em;
}

.article-body pre {
  overflow-x: auto;
  padding: 16px;
  background: #102331;
  border-radius: 8px;
  line-height: 1.55;
}

.article-body pre code {
  padding: 0;
  color: #e8f7ff;
  background: transparent;
  font-size: 0.88rem;
}

.contact p {
  margin-bottom: 6px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-top: 26px;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 680px) {
  .page {
    width: min(100% - 28px, 920px);
    padding-top: 32px;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 18px;
    text-align: left;
  }

  .avatar {
    width: 118px;
    height: 118px;
  }

  h1 {
    font-size: 2.1rem;
  }

  .entry-head,
  .list li,
  .projects li,
  .footer {
    grid-template-columns: 1fr;
  }

  .entry-head {
    display: grid;
    gap: 2px;
  }

  .entry-head span,
  .date {
    white-space: normal;
  }

  .list li,
  .projects li {
    gap: 2px;
  }

  .article-body pre {
    margin-right: -4px;
    margin-left: -4px;
  }

  .series-grid,
  .article-shell {
    grid-template-columns: 1fr;
  }

  .article-shell {
    gap: 18px;
    padding-top: 22px;
  }

  .toc {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 14px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
  }

  .toc-title {
    grid-column: 1 / -1;
  }

  .toc nav {
    grid-column: 1 / -1;
  }
}
