/* 博客列表页样式 — 需在 main.css 之后加载（依赖 :root CSS 变量） */

@keyframes blog-fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Blog ── */

.content-page:has(.blog-page),
.content-page:has(.blog-article) {
  background:
    radial-gradient(ellipse 70% 50% at 8% -8%, rgba(14, 165, 233, 0.14), transparent 55%),
    radial-gradient(ellipse 55% 40% at 100% 0%, rgba(139, 92, 246, 0.1), transparent 50%),
    radial-gradient(ellipse 40% 30% at 80% 100%, rgba(249, 115, 22, 0.06), transparent 50%);
}

.blog-page__actions {
  margin-top: 48px;
  text-align: center;
}

@media (min-width: 768px) {
  .blog-page__actions {
    text-align: left;
  }
}

.blog-masthead {
  display: grid;
  gap: 24px;
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--slate-200);
  animation: blog-fade-up 0.5s ease both;
}

@media (min-width: 768px) {
  .blog-masthead {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 40px;
    margin-bottom: 44px;
  }
}

.blog-masthead__kicker {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ice-700);
}

.blog-masthead__title {
  margin: 0 0 12px;
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--slate-900);
}

.blog-masthead__intro {
  margin: 0;
  max-width: 38rem;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--slate-600);
}

.blog-masthead__stats {
  display: flex;
  gap: 28px;
  margin: 0;
}

.blog-masthead__stats div {
  min-width: 0;
}

.blog-masthead__stats dt {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-400);
}

.blog-masthead__stats dd {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--slate-800);
}

.blog-layout {
  display: grid;
  gap: 40px;
}

@media (min-width: 1024px) {
  .blog-layout {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 48px;
    align-items: start;
  }
}

.blog-feature {
  display: grid;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  animation: blog-fade-up 0.55s ease both;
}

@media (min-width: 800px) {
  .blog-feature {
    grid-template-columns: 240px minmax(0, 1fr);
  }
}

.blog-feature__visual {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 180px;
  padding: 24px;
  background:
    linear-gradient(160deg, #0c4a6e 0%, #075985 45%, #4c1d95 100%);
  color: #e0f2fe;
  text-decoration: none;
}

.blog-feature__index {
  font-family: 'Fira Code', ui-monospace, monospace;
  font-size: 2.5rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.06em;
  color: rgba(255, 255, 255, 0.92);
}

.blog-feature__code {
  margin: 20px 0 0;
  font-family: 'Fira Code', ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.55;
  color: #bae6fd;
  white-space: pre;
}

.blog-feature__body {
  display: flex;
  flex-direction: column;
  padding: 24px;
}

@media (min-width: 800px) {
  .blog-feature__body {
    padding: 32px 36px;
  }
}

.blog-feature__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-500);
}

.blog-feature__title {
  margin: 0 0 12px;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.blog-feature__title a {
  color: var(--slate-900);
  text-decoration: none;
}

.blog-feature__title a:hover {
  color: var(--ice-700);
}

.blog-feature__excerpt {
  display: -webkit-box;
  margin: 0 0 20px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  color: var(--slate-600);
  line-height: 1.7;
}

.blog-feature__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  font-size: 15px;
  font-weight: 600;
  color: var(--ice-700);
  text-decoration: none;
}

.blog-feature__cta svg {
  width: 16px;
  height: 16px;
}

.blog-feature__cta:hover {
  color: var(--ice-800);
}

.blog-feed {
  margin-top: 36px;
}

.blog-feed__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--slate-200);
}

.blog-feed__head h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--slate-900);
}

.blog-feed__head p {
  margin: 0;
  font-size: 13px;
  color: var(--slate-400);
}

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

.blog-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--slate-100);
}

.blog-row:hover .blog-row__title a {
  color: var(--ice-700);
}

.blog-row__date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 52px;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  background: #fff;
  font-family: 'Fira Code', ui-monospace, monospace;
  line-height: 1.15;
  color: var(--slate-500);
}

.blog-row__date span:first-child {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.blog-row__date span:last-child {
  font-size: 18px;
  font-weight: 600;
  color: var(--slate-800);
}

.blog-row__meta {
  margin-bottom: 8px;
}

.blog-row__title {
  margin: 0 0 8px;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
}

.blog-row__title a {
  color: var(--slate-900);
  text-decoration: none;
}

.blog-row__excerpt {
  display: -webkit-box;
  margin: 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--slate-600);
}

.blog-aside {
  display: grid;
  gap: 16px;
}

@media (min-width: 1024px) {
  .blog-aside {
    position: sticky;
    top: 88px;
  }
}

.blog-aside__panel {
  padding: 20px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--slate-200);
  border-radius: 16px;
}

.blog-aside__panel h2 {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-500);
}

.blog-aside__hint {
  margin: -4px 0 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--slate-500);
}

.blog-topics,
.blog-tools {
  margin: 0;
  padding: 0;
  list-style: none;
}

.blog-topics a,
.blog-tools a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--slate-100);
  color: var(--slate-700);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.blog-topics li:last-child a,
.blog-tools li:last-child a {
  border-bottom: 0;
  padding-bottom: 0;
}

.blog-topics a:hover,
.blog-tools a:hover {
  color: var(--ice-700);
}

.blog-topics a span:last-child {
  color: var(--slate-400);
  font-family: 'Fira Code', ui-monospace, monospace;
  font-size: 12px;
}

.blog-aside .blog-back-btn {
  justify-content: center;
}

.blog-article__date-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.blog-card__badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.blog-card__badge--tutorial {
  background: linear-gradient(135deg, #dbeafe, #e0f2fe);
  color: #1e40af;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.blog-card__badge--comparison {
  background: linear-gradient(135deg, #ede9fe, #f3e8ff);
  color: #5b21b6;
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.12);
}

.blog-card__badge--best-practices {
  background: linear-gradient(135deg, #dcfce7, #d1fae5);
  color: #166534;
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.12);
}

.blog-card__badge--tool-guide {
  background: linear-gradient(135deg, #ffedd5, #fed7aa);
  color: #9a3412;
  box-shadow: 0 0 0 1px rgba(234, 88, 12, 0.14);
}

.blog-card__title {
  margin: 0 0 12px;
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--slate-900);
}

.blog-card__title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog-card__title a:hover {
  color: var(--ice-500);
}

.blog-card__excerpt {
  display: -webkit-box;
  margin: 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  color: var(--slate-600);
  line-height: 1.65;
}

.blog-card__footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--slate-100);
}

.blog-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ice-600);
  text-decoration: none;
  transition: color 0.2s ease, gap 0.2s ease;
}

.blog-card__link:hover {
  color: var(--ice-700);
  gap: 10px;
}

.blog-card__link-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.blog-card:hover .blog-card__link-icon {
  transform: translateX(4px);
}

.blog-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--slate-300);
  border-radius: 8px;
  background: #fff;
  color: var(--slate-700);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.blog-back-btn:hover {
  background: var(--ice-50);
  color: var(--ice-800);
  border-color: var(--ice-200);
}

.blog-back-btn--compact {
  padding: 8px 14px;
  font-size: 14px;
}

.blog-back-btn__icon {
  width: 16px;
  height: 16px;
}

.blog-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 40px;
}

@media (min-width: 768px) {
  .blog-pagination {
    justify-content: space-between;
  }
}

.blog-pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 8px 16px;
  border: 1px solid var(--slate-300);
  border-radius: 8px;
  background: #fff;
  color: var(--slate-700);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.blog-pagination__btn:hover {
  background: var(--slate-50);
  color: var(--slate-900);
}

.blog-pagination__btn--disabled {
  opacity: 0.45;
  cursor: default;
}

.blog-pagination__pages {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.blog-pagination__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--slate-600);
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.blog-pagination__page:hover {
  background: var(--slate-100);
  color: var(--slate-900);
}

.blog-pagination__page--active {
  background: var(--ice-100);
  color: var(--ice-700);
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .blog-masthead,
  .blog-feature {
    animation: none;
  }
}
