/* ============================================================
   blog.css — 中文博客列表 v2（依赖 body.home-forest + index.css 森林变量）
   ============================================================ */

.pgb {
  --pgb-max: 760px;
  --pgb-rail: 4px;
  position: relative;
  z-index: 1;
}

.pgb-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pgb-anchor {
  display: block;
  height: 0;
  overflow: hidden;
}

.pgb-skip {
  position: absolute;
  left: -9999px;
  top: auto;
  z-index: 10000;
}
.pgb-skip:focus-within {
  left: 16px;
  top: 72px;
}
.pgb-skip a {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 13px;
  background: #14532d;
  color: #ecfdf5;
  border: 1px solid rgba(134, 239, 172, 0.5);
  text-decoration: none;
}

/* ── 顶栏 ── */
.pgb-mast {
  padding: 88px 0 32px;
  border-bottom: 1px solid rgba(167, 243, 208, 0.1);
}

.pgb-mast__inner {
  max-width: var(--nav-inner-max, 1180px);
  margin: 0 auto;
  padding: 0 20px;
}

.pgb-crumb {
  font-size: 13px;
  font-weight: 700;
  color: rgba(236, 253, 245, 0.45);
  margin-bottom: 14px;
}

.pgb-crumb a {
  color: rgba(167, 243, 208, 0.85);
  text-decoration: none;
}
.pgb-crumb a:hover {
  text-decoration: underline;
}

.pgb-crumb span[aria-current='page'] {
  color: rgba(236, 253, 245, 0.55);
}

.pgb-mast__title {
  font-size: clamp(28px, 4.2vw, 40px);
  font-weight: 900;
  letter-spacing: -0.6px;
  line-height: 1.15;
  color: var(--fr-mist, #ecfdf5);
  margin: 0 0 10px;
  background: linear-gradient(135deg, #ecfdf5 0%, #86efac 55%, #4ade80 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.pgb-mast__lead {
  margin: 0;
  max-width: 36em;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.55;
  color: rgba(236, 253, 245, 0.58);
}

/* ── 主面板 ── */
.pgb-panel {
  max-width: var(--nav-inner-max, 1180px);
  margin: 0 auto;
  padding: 24px 20px 96px;
}

.pgb-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(167, 243, 208, 0.1);
}

.pgb-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pgb-tab {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(167, 243, 208, 0.2);
  background: rgba(10, 22, 18, 0.45);
  color: rgba(236, 253, 245, 0.75);
  font-size: 13px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.pgb-tab:hover {
  border-color: rgba(74, 222, 128, 0.45);
  color: var(--fr-mist, #ecfdf5);
}

.pgb-tab[aria-pressed='true'] {
  border-color: transparent;
  color: #ecfdf5;
  background: linear-gradient(135deg, #14532d, #166534 55%, #15803d 100%);
  box-shadow: 0 6px 18px -8px rgba(22, 101, 52, 0.28);
}

.pgb-tab:focus-visible {
  outline: 2px solid #86efac;
  outline-offset: 2px;
}

.pgb-search-wrap {
  flex: 1 1 200px;
  min-width: 0;
  max-width: 320px;
  position: relative;
  margin-left: auto;
}

.pgb-search {
  width: 100%;
  padding: 10px 40px 10px 38px;
  border-radius: 12px;
  border: 1px solid rgba(167, 243, 208, 0.2);
  background: rgba(10, 22, 18, 0.65);
  color: var(--fr-mist, #ecfdf5);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
}
.pgb-search::placeholder {
  color: rgba(236, 253, 245, 0.35);
}
.pgb-search:focus {
  border-color: rgba(74, 222, 128, 0.5);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.15);
}

.pgb-search-wrap::before {
  content: '⌕';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.45;
  pointer-events: none;
}

.pgb-search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(236, 253, 245, 0.6);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.pgb-search-clear:hover {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
}

.pgb-stat {
  flex: 0 0 auto;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: rgba(236, 253, 245, 0.42);
}
.pgb-stat strong {
  color: rgba(167, 243, 208, 0.95);
  font-weight: 900;
}

/* ── 列表（杂志行） ── */
.pgb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: var(--pgb-max);
}

.pgb-row {
  margin: 0;
}

.pgb-row__link,
.pgb-row__shell {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px 20px;
  align-items: start;
  padding: 22px 22px 22px 20px;
  border-radius: 18px;
  border: 1px solid rgba(167, 243, 208, 0.12);
  background: rgba(15, 31, 24, 0.48);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.22s ease, background 0.22s ease, transform 0.22s ease;
}

.pgb-row__link:hover {
  border-color: rgba(74, 222, 128, 0.28);
  background: rgba(18, 40, 30, 0.55);
  transform: translateX(2px);
}

.pgb-row__link:focus-visible {
  outline: 2px solid #86efac;
  outline-offset: 2px;
}

.pgb-row__lead {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.pgb-row__rail {
  width: var(--pgb-rail);
  min-height: 48px;
  border-radius: 4px;
  background: linear-gradient(180deg, #166534, #14532d);
  flex-shrink: 0;
}

.pgb-row[data-cat='openclaw'] .pgb-row__rail {
  background: linear-gradient(180deg, #fde68a, #f59e0b);
}

.pgb-row[data-cat='guide'] .pgb-row__rail {
  background: linear-gradient(180deg, #a5b4fc, #6366f1);
}

.pgb-row__emoji {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(220, 252, 231, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.pgb-row__emoji .pgb-row__svg {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}

.pgb-row__body {
  min-width: 0;
}

.pgb-row__tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(187, 247, 208, 0.9);
  margin-bottom: 8px;
}

.pgb-row__title {
  font-size: 17px;
  font-weight: 900;
  line-height: 1.35;
  letter-spacing: -0.2px;
  color: var(--fr-mist, #ecfdf5);
  margin: 0 0 8px;
}

.pgb-row__sum {
  font-size: 14px;
  line-height: 1.55;
  color: rgba(236, 253, 245, 0.55);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pgb-row__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: rgba(236, 253, 245, 0.4);
  text-align: right;
  padding-top: 2px;
}

.pgb-row__cta {
  font-size: 12px;
  font-weight: 900;
  color: #86efac;
  letter-spacing: 0.02em;
}

.pgb-row__link:hover .pgb-row__cta {
  color: #bbf7d0;
}

.pgb-row--soon .pgb-row__shell {
  border-style: dashed;
  opacity: 0.85;
  cursor: default;
}

.pgb-list .pgb-row__link {
  animation: pgbRowIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.pgb-list .pgb-row:nth-child(1) .pgb-row__link {
  animation-delay: 0.02s;
}
.pgb-list .pgb-row:nth-child(2) .pgb-row__link {
  animation-delay: 0.06s;
}
.pgb-list .pgb-row:nth-child(3) .pgb-row__link {
  animation-delay: 0.1s;
}
.pgb-list .pgb-row:nth-child(4) .pgb-row__link {
  animation-delay: 0.14s;
}
.pgb-list .pgb-row:nth-child(5) .pgb-row__link {
  animation-delay: 0.18s;
}
.pgb-list .pgb-row:nth-child(6) .pgb-row__link {
  animation-delay: 0.22s;
}

@keyframes pgbRowIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pgb-list .pgb-row__link {
    animation: none;
  }
  .pgb-row__link:hover {
    transform: none;
  }
}

/* ── 空状态 ── */
.pgb-empty {
  text-align: center;
  padding: 48px 20px 56px;
  border-radius: 18px;
  border: 1px dashed rgba(167, 243, 208, 0.2);
  background: rgba(15, 31, 24, 0.35);
  max-width: var(--pgb-max);
  margin-bottom: 24px;
}

.pgb-empty__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  color: rgba(167, 243, 208, 0.55);
}

.pgb-empty__svg {
  display: block;
}

.pgb-empty__title {
  font-size: 17px;
  font-weight: 900;
  color: var(--fr-mist, #ecfdf5);
  margin: 0 0 8px;
}

.pgb-empty__text {
  font-size: 14px;
  color: rgba(236, 253, 245, 0.5);
  margin: 0;
}

/* ── 分页 ── */
.pgb-pager {
  margin-top: 36px;
  padding-top: 8px;
  max-width: var(--pgb-max);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.pgb-pager__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pgb-pager__btn {
  min-width: 40px;
  padding: 9px 13px;
  border-radius: 10px;
  border: 1px solid rgba(167, 243, 208, 0.2);
  background: rgba(15, 31, 24, 0.5);
  font-size: 13px;
  font-weight: 800;
  font-family: inherit;
  color: rgba(236, 253, 245, 0.88);
  cursor: pointer;
}
.pgb-pager__btn:hover:not(:disabled) {
  border-color: rgba(74, 222, 128, 0.4);
  color: #bbf7d0;
}
.pgb-pager__btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.pgb-pager__btn.is-on {
  border-color: transparent;
  color: #ecfdf5;
  background: linear-gradient(135deg, #14532d, #15803d);
}

.pgb-pager__gap {
  padding: 0 4px;
  font-weight: 800;
  color: rgba(236, 253, 245, 0.3);
  user-select: none;
}

.pgb-pager__info {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: rgba(236, 253, 245, 0.42);
}
.pgb-pager__info strong {
  color: rgba(167, 243, 208, 0.9);
}

@media (max-width: 640px) {
  .pgb-mast {
    padding-top: 80px;
    padding-bottom: 24px;
  }

  .pgb-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .pgb-search-wrap {
    max-width: none;
    margin-left: 0;
  }

  .pgb-stat {
    text-align: center;
  }

  .pgb-row__link,
  .pgb-row__shell {
    grid-template-columns: 1fr;
    padding: 18px 16px;
  }

  .pgb-row__lead {
    width: 100%;
  }

  .pgb-row__meta {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 10px 14px;
    width: 100%;
    text-align: left;
    padding-top: 0;
  }

  .pgb-row__cta {
    margin-left: auto;
  }
}
