

.blog-main {
  position: relative;
  z-index: 1;
  padding-top: 128px;
  padding-bottom: 40px;
}

.blog-section {
  margin-top: 72px;
}

.blog-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.blog-section-head h2 {
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}
.blog-section-head p {
  color: var(--muted);
  font-size: 0.92rem;
}

.blog-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.05;
  margin-bottom: 20px;
}
.blog-hero .lead {
  max-width: 640px;
  font-size: 1.05rem;
}
.blog-hero-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  margin-top: 28px;
  font-size: 0.85rem;
  color: var(--muted);
}
.blog-hero-stats strong {
  color: var(--text);
  font-weight: 600;
}

.blog-hero-cat h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  margin-bottom: 0;
}
.blog-cat-title {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 26px 0 18px 7px;
}
.blog-cat-ico,
.blog-topic-ico,
.post-cta-ico {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.blog-ico {
  width: 20px;
  height: 20px;
}

.blog-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}
.blog-crumbs a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.blog-crumbs a:hover {
  color: var(--text);
}
.blog-crumbs .sep {
  opacity: 0.4;
}
.blog-crumbs [aria-current] {
  color: var(--text);
}

.blog-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
  white-space: nowrap;
}
a.blog-tag:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.blog-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.blog-cards-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.blog-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background-color: #0d0d0d;
  background-image: var(--noise);
  background-size: 180px 180px;
  text-decoration: none;
  transition:
    border-color 0.2s,
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.blog-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}
.blog-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.blog-card-num {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
}
.blog-card h3 {
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: #fff;
}
.blog-card p {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card-meta {
  margin-top: auto;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
}

.blog-topics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.blog-topic {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 18px 20px 25px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: var(--bg2);
  text-decoration: none;
  transition: border-color 0.2s;
}
.blog-topic:hover {
  border-color: rgba(255, 255, 255, 0.18);
}
.blog-topic-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.blog-topic-body strong {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}
.blog-topic-body span {
  font-size: 0.78rem;
  color: var(--muted);
}
.blog-topic-arrow {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex-shrink: 0;
  transition:
    transform 0.2s,
    color 0.2s;
}
.blog-topic:hover .blog-topic-arrow {
  color: #fff;
  transform: translateX(3px);
}

.blog-list-head {
  align-items: center;
}
.blog-count {
  font-size: 0.85rem !important;
}
.blog-search {
  position: relative;
  display: flex;
  align-items: center;
  width: min(340px, 100%);
}
.blog-search svg {
  position: absolute;
  left: 14px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}
.blog-search input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--bg2);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
.blog-search input:focus {
  border-color: rgba(255, 255, 255, 0.3);
}
.blog-search input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.blog-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.blog-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-family: var(--font);
  font-size: 0.82rem;
  text-decoration: none;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s,
    color 0.15s;
}
.blog-chip span {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
}
.blog-chip:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}
.blog-chip.is-active {
  background: #fff;
  border-color: #fff;
  color: #0a0a0a;
}
.blog-chip.is-active span {
  color: rgba(0, 0, 0, 0.5);
}

.blog-list {
  list-style: none;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.blog-row {
  padding: 22px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.blog-row[hidden] {
  display: none;
}
.blog-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 10px;
}
.blog-row h3 {
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin-bottom: 6px;
}
.blog-row h3 a {
  color: #fff;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.3s ease;
}
.blog-row h3 a:hover {
  background-size: 100% 1px;
}
.blog-row p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 780px;
}
.blog-empty {
  padding: 40px 0;
  text-align: center;
  color: var(--muted);
}
.blog-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}
.blog-more {
  height: 44px;
  padding: 0 22px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--bg2);
  color: #fff;
  font-family: var(--font);
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.2s;
}
.blog-more:hover {
  border-color: rgba(255, 255, 255, 0.3);
}
.blog-more[hidden] {
  display: none;
}

.post-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: #fff;
  z-index: 1001;
  pointer-events: none;
}

.post-hero {
  max-width: 1180px;
}
.post-hero .blog-crumbs {
  margin-bottom: 22px;
}
.post-hero h1 {
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.08;
  max-width: 860px;
  margin: 18px 0 16px;
}
.post-dek {
  font-size: 1.08rem;
  line-height: 1.65;
  color: var(--muted);
  max-width: 720px;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  margin-top: 26px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.84rem;
  color: var(--muted);
}
.post-author {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 500;
}
.post-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #0a0a0a;
  font-size: 0.75rem;
  font-weight: 700;
}

.post-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 64px;
  margin-top: 44px;
}
.post-main {
  min-width: 0;
  max-width: 740px;
}

.post-toc {
  position: sticky;
  top: 104px;
  align-self: start;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
}
.post-toc-title {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 14px;
}
.post-toc ol,
.post-toc-mobile ol {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.post-toc a,
.post-toc-mobile a {
  display: block;
  padding: 6px 0 6px 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
  text-decoration: none;
  transition:
    color 0.15s,
    border-color 0.15s;
}
.post-toc a:hover,
.post-toc-mobile a:hover {
  color: #fff;
}
.post-toc a.is-active {
  color: #fff;
  border-left-color: #fff;
}
.post-toc-mobile {
  display: none;
  margin-bottom: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: var(--bg2);
}
.post-toc-mobile summary {
  padding: 14px 18px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.post-toc-mobile summary::-webkit-details-marker {
  display: none;
}
.post-toc-mobile summary::after {
  content: "+";
  float: right;
  color: var(--muted);
}
.post-toc-mobile[open] summary::after {
  content: "−";
}
.post-toc-mobile ol {
  padding: 0 18px 14px;
}

.prose {
  font-size: 1.02rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.78);
}
.prose > * + * {
  margin-top: 1.15em;
}
.prose h2 {
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: #fff;
  margin: 2.2em 0 0.1em;
  scroll-margin-top: 100px;
}
.prose h3 {
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.35;
  color: #fff;
  margin-top: 1.8em;
  scroll-margin-top: 100px;
}
.prose h2 + *,
.prose h3 + * {
  margin-top: 0.7em;
}
.prose strong {
  color: #fff;
  font-weight: 600;
}
.prose a {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}
.prose a:hover {
  text-decoration-color: #fff;
}
.prose ul,
.prose ol {
  padding-left: 1.3em;
}
.prose li + li {
  margin-top: 0.45em;
}
.prose li::marker {
  color: rgba(255, 255, 255, 0.4);
}
.prose hr {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 2.4em 0;
}
.prose :not(pre) > code {
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 0.15em 0.4em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  overflow-wrap: anywhere;
}
.prose pre {
  position: relative;
  overflow-x: auto;
  padding: 20px 20px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0d0d0f;
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
}
.prose pre[data-lang] {
  padding-top: 40px;
}
.prose pre[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 12px;
  left: 20px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}
.prose pre code {
  font-family: inherit;
  white-space: pre;
}
.code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  cursor: pointer;
  opacity: 0;
  transition:
    opacity 0.15s,
    color 0.15s;
}
.prose pre:hover .code-copy,
.code-copy:focus-visible {
  opacity: 1;
}
.code-copy:hover {
  color: #fff;
}
@media (hover: none) {
  .code-copy {
    opacity: 1;
  }
}

.post-table {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  line-height: 1.55;
}
.prose th,
.prose td {
  padding: 11px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.prose th {
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}
.prose tr:last-child td {
  border-bottom: 0;
}

.prose blockquote {
  padding: 16px 20px;
  border-left: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 0 12px 12px 0;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.8);
}
.prose blockquote > * + * {
  margin-top: 0.7em;
}
.callout-tip {
  border-left-color: #4ade80 !important;
  background: rgba(74, 222, 128, 0.05) !important;
}
.callout-note {
  border-left-color: #60a5fa !important;
  background: rgba(96, 165, 250, 0.05) !important;
}
.callout-warning,
.callout-important {
  border-left-color: #fbbf24 !important;
  background: rgba(251, 191, 36, 0.05) !important;
}

.post-cta {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-top: 56px;
  padding: 26px 26px 26px 33px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background-color: #0d0d0d;
  background-image: var(--noise);
  background-size: 180px 180px;
}
.post-cta-body {
  flex: 1;
  min-width: 0;
}
.post-cta h2 {
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.post-cta p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--muted);
}
.post-cta-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  background: #fff;
  color: #0a0a0a;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.post-cta-btn:hover {
  opacity: 0.88;
}

.post-related {
  margin-top: 88px;
  padding-top: 56px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

@media (max-width: 1080px) {
  .blog-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .blog-topics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .post-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .post-toc {
    display: none;
  }
  .post-toc-mobile {
    display: block;
  }
  .post-main {
    max-width: 760px;
  }
}
@media (max-width: 720px) {
  .blog-main {
    padding-top: 108px;
  }
  .blog-section {
    margin-top: 56px;
  }
  .blog-cards,
  .blog-cards-3,
  .blog-topics {
    grid-template-columns: minmax(0, 1fr);
  }
  .blog-search {
    width: 100%;
  }
  .blog-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-right: -20px;
    padding-right: 20px;
    scrollbar-width: none;
  }
  .blog-chips::-webkit-scrollbar {
    display: none;
  }
  .blog-chip {
    flex-shrink: 0;
  }
  .prose {
    font-size: 0.98rem;
  }
  .prose h2 {
    font-size: 1.4rem;
  }
  .prose pre {
    margin-left: -4px;
    margin-right: -4px;
    font-size: 0.8rem;
  }
  .post-cta {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 24px 22px 24px 29px;
  }
}
