/* babianai.com — Docs / Posts / Category extra styles
   保持紫黑风格，沿用 wqpnkmfbtz.css 的 --purple-*、--bg-*、--text 变量
   仅扩充教程列表、文章页、分类页、面包屑、TOC、FAQ 视觉
*/

/* ====== Breadcrumb ====== */
.crumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 0.85rem; color: var(--white-60);
  padding: 24px 0 8px;
}
.crumb a { color: var(--purple-3); transition: color var(--transition); }
.crumb a:hover { color: var(--white); }
.crumb__sep { color: var(--white-40); }
.crumb__current { color: var(--white-80); }

/* ====== Docs Section（首页插入「最新教程」与「教程分类」） ====== */
.docs-section {
  padding: 80px 0;
  position: relative;
}
.docs-section .section-header { margin-bottom: 48px; }

.docs-cardgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

.docs-card {
  display: block;
  padding: 22px 22px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}
.docs-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(108,71,255,0.10), transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}
.docs-card:hover {
  border-color: var(--purple-border);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(108,71,255,0.12);
}
.docs-card:hover::before { opacity: 1; }

.docs-card__title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
  line-height: 1.35;
}
.docs-card__desc {
  font-size: 0.88rem;
  color: var(--white-60);
  line-height: 1.6;
  margin-bottom: 14px;
}
.docs-card__list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}
.docs-card__list li {
  font-size: 0.84rem;
  color: var(--white-60);
  padding: 4px 0;
  display: flex;
  gap: 6px;
  line-height: 1.45;
}
.docs-card__bullet { color: var(--purple-3); flex-shrink: 0; }
.docs-card__count {
  font-size: 0.78rem;
  color: var(--purple-3);
  margin-top: 12px;
  font-weight: 600;
}

/* ====== Post List（首页「最新教程」 / /docs/ 列表 / 分类页列表） ====== */
.postlist { list-style: none; padding: 0; margin: 0; }
.postlist__item {
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}
.postlist__item:last-child { border-bottom: none; }

.postlist__title {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.01em;
  line-height: 1.4;
  margin-bottom: 8px;
  transition: color var(--transition);
}
.postlist__title:hover { color: var(--purple-3); }

.postlist__meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 0.82rem;
  color: var(--white-40);
  margin-bottom: 8px;
}
.postlist__date::before { content: '· '; color: var(--white-40); }
.postlist__date:first-child::before { content: ''; }
.postlist__chip {
  background: rgba(108,71,255,0.12);
  border: 1px solid var(--purple-border);
  color: var(--purple-3);
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 0.74rem;
  font-weight: 600;
}
.postlist__desc {
  color: var(--white-60);
  line-height: 1.65;
  font-size: 0.92rem;
}

.viewall {
  margin-top: 28px;
  text-align: center;
}
.viewall a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--purple-3);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color var(--transition);
}
.viewall a:hover { color: var(--white); }

/* ====== Page Hero（教程列表 / 分类 / 文章 顶部） ====== */
.page-hero {
  padding: 64px 0 36px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.page-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 14px;
  color: var(--white);
}
.page-hero__lede {
  font-size: 1.05rem;
  color: var(--white-60);
  max-width: 720px;
  line-height: 1.7;
}
.page-hero__meta {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
  margin-top: 18px; font-size: 0.85rem; color: var(--white-40);
}

/* ====== Article Body ====== */
.article {
  padding: 36px 0 72px;
}
.article__layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 48px;
  max-width: 1140px;
  margin: 0 auto;
}
@media (max-width: 900px) {
  .article__layout { grid-template-columns: 1fr; gap: 24px; }
}

.prose {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.85;
}
.prose h2 {
  font-size: 1.55rem;
  margin: 44px 0 18px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
  padding-top: 8px;
  scroll-margin-top: 80px;
}
.prose h3 {
  font-size: 1.2rem;
  margin: 28px 0 12px;
  font-weight: 600;
  color: var(--white);
  scroll-margin-top: 80px;
}
.prose p { margin: 14px 0; color: var(--white-80); }
.prose strong { color: var(--white); font-weight: 700; }
.prose a {
  color: var(--purple-3);
  text-decoration: underline;
  text-decoration-color: var(--purple-border);
  text-underline-offset: 3px;
  transition: color var(--transition);
}
.prose a:hover { color: var(--white); }
.prose ul, .prose ol { margin: 14px 0; padding-left: 28px; color: var(--white-80); }
.prose li { margin: 6px 0; line-height: 1.75; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.92rem;
}
.prose th, .prose td {
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  color: var(--white-80);
}
.prose th {
  background: var(--bg-3);
  color: var(--white);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
}
.prose tr:last-child td { border-bottom: none; }
.prose blockquote {
  border-left: 3px solid var(--purple-1);
  padding: 6px 18px;
  margin: 18px 0;
  background: rgba(108,71,255,0.06);
  color: var(--white-80);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.prose code {
  background: var(--bg-3);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--purple-3);
}

/* ====== TOC ====== */
.toc {
  position: sticky;
  top: 88px;
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 18px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
}
.toc__title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.toc__list { list-style: none; padding: 0; margin: 0; }
.toc__item { padding: 4px 0; }
.toc__item a {
  display: block;
  font-size: 0.85rem;
  color: var(--white-60);
  line-height: 1.5;
  transition: color var(--transition);
}
.toc__item--lv3 a { padding-left: 12px; font-size: 0.82rem; color: var(--white-40); }
.toc__item a:hover { color: var(--purple-3); }
.toc__more {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
@media (max-width: 900px) {
  .toc { position: static; max-height: none; }
}

/* ====== Prev / Next ====== */
.prevnext {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 48px 0 0;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
@media (max-width: 640px) {
  .prevnext { grid-template-columns: 1fr; }
}
.prevnext__item {
  display: block;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  transition: all var(--transition);
}
.prevnext__item:hover {
  border-color: var(--purple-border);
  background: var(--bg-card-hover);
}
.prevnext__lab {
  font-size: 0.78rem;
  color: var(--purple-3);
  font-weight: 600;
  margin-bottom: 4px;
  display: block;
}
.prevnext__t {
  font-size: 0.95rem;
  color: var(--white);
  font-weight: 600;
  line-height: 1.4;
  display: block;
}
.prevnext__next { text-align: right; }

/* ====== Pagination ====== */
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 36px;
  flex-wrap: wrap;
}
.pager__btn, .pager__num {
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--white-80);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition);
}
.pager__btn:hover, .pager__num:hover {
  border-color: var(--purple-border);
  color: var(--white);
}
.pager__num.is-current {
  background: var(--purple-1);
  color: var(--white);
  border-color: var(--purple-1);
}
.pager__btn.is-disabled { opacity: 0.4; pointer-events: none; }

/* ====== FAQ ====== */
.faq { margin: 24px 0; display: flex; flex-direction: column; gap: 12px; }
.faq__item {
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.faq__q {
  cursor: pointer;
  padding: 16px 22px;
  font-weight: 600;
  color: var(--white);
  list-style: none;
  position: relative;
  font-size: 0.98rem;
  transition: color var(--transition);
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q::after {
  content: '+';
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--purple-3);
  font-size: 1.4rem;
  transition: transform var(--transition);
}
details[open] .faq__q::after { content: '−'; }
.faq__a {
  padding: 0 22px 18px;
  color: var(--white-80);
  font-size: 0.92rem;
  line-height: 1.7;
}

/* ====== Chip / Tag list ====== */
.chip {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(108,71,255,0.12);
  border: 1px solid var(--purple-border);
  color: var(--purple-3);
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all var(--transition);
}
.chip:hover { background: rgba(108,71,255,0.2); color: var(--white); }

/* ====== 404 ====== */
.err-404 {
  text-align: center;
  padding: 120px 24px;
  max-width: 480px;
  margin: 0 auto;
}
.err-404__code {
  font-size: 6rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--purple-3), var(--purple-1));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 20px;
}
.err-404__title { font-size: 1.8rem; color: var(--white); margin-bottom: 14px; }
.err-404__body { color: var(--white-60); margin-bottom: 30px; }

/* ====== Mini nav extension（旧 nav 加一项「教程」） ====== */
.nav-links a.is-active { color: var(--white); background: var(--white-15); }

/* ---------- Category blocks (homepage) ---------- */
.cat-list { display: grid; gap: 24px; max-width: 1100px; margin: 0 auto; }
.cat-block { border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 24px 28px; background: rgba(255,255,255,0.02); }
.cat-block__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.cat-block__title { font-size: 20px; font-weight: 700; }
.cat-block__more { font-size: 14px; text-decoration: none; opacity: .85; }
.cat-block__more:hover { opacity: 1; text-decoration: underline; }
.cat-block__desc { font-size: 14px; opacity: .7; margin: 0 0 14px; }
.cat-block__list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
.cat-block__list li { padding-left: 18px; position: relative; font-size: 14px; line-height: 1.6; }
.cat-block__list li::before { content: "›"; position: absolute; left: 0; font-weight: 700; opacity: .7; }
.cat-block__list a { color: inherit; text-decoration: none; }
.cat-block__list a:hover { text-decoration: underline; }
.cat-block__empty { font-size: 14px; opacity: .6; font-style: italic; }
@media (max-width: 720px) { .cat-block__list { grid-template-columns: 1fr; } }

/* === V-B: Side + Main === */
.cat-layout { display: grid; grid-template-columns: 220px 1fr; gap: 36px; max-width: 1100px; margin: 0 auto; align-items: start; }
@media (max-width: 768px) { .cat-layout { grid-template-columns: 1fr; } }
.cat-side { position: sticky; top: 80px; }
.cat-side ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; border-left: 2px solid rgba(255,255,255,0.08); }
.cat-side__link { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; text-decoration: none; color: inherit; opacity: 0.7; transition: opacity 0.15s, border-color 0.15s; border-left: 2px solid transparent; margin-left: -2px; }
.cat-side__link:hover { opacity: 1; border-left-color: var(--accent, #7c5cff); }
.cat-side__link span { font-size: 11px; opacity: 0.6; padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,0.06); }
.cat-main { display: flex; flex-direction: column; gap: 36px; }
.cat-section { padding: 22px 26px; border-radius: 16px; background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.06); scroll-margin-top: 80px; }
.cat-section__head { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px dashed rgba(255,255,255,0.08); }
.cat-section__title { font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.cat-section__title a { color: inherit; text-decoration: none; }
.cat-section__title a:hover { color: var(--accent, #7c5cff); }
.cat-section__desc { font-size: 13px; opacity: 0.6; margin: 0; }
.cat-section__list { list-style: decimal; padding-left: 22px; margin: 0; display: grid; gap: 12px; counter-reset: catpost; }
.cat-section__list li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.cat-section__link { color: inherit; text-decoration: none; flex: 1; }
.cat-section__title-line { display: block; font-size: 15px; font-weight: 500; }
.cat-section__excerpt { display: block; font-size: 12px; opacity: 0.55; margin-top: 3px; }
.cat-section__date { font-size: 11px; opacity: 0.45; white-space: nowrap; }
.cat-section__more { display: inline-block; margin-top: 14px; font-size: 13px; opacity: 0.85; text-decoration: none; }
.cat-section__more:hover { opacity: 1; }
.cat-section__empty { padding: 28px; text-align: center; opacity: 0.5; font-size: 13px; }

/* ============================================================
   V-B 紫色主题覆盖（匹配 biabafox 站调性 --purple-3 #a98bff）
   ============================================================ */

/* --- cat-layout: grid 左侧栏 + 右主区 --- */
.cat-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  max-width: 1140px;
  margin: 0 auto;
  align-items: start;
}
@media (max-width: 900px) {
  .cat-layout { grid-template-columns: 1fr; gap: 24px; }
}

/* --- cat-side: 紫色侧栏导航 --- */
.cat-side {
  position: sticky;
  top: 88px;
  padding: 18px 6px 18px 0;
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
}
@media (max-width: 900px) {
  .cat-side { position: static; }
}
.cat-side ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 2px solid var(--border);
}
.cat-side ul li { margin: 0; }
.cat-side__link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--white-60);
  text-decoration: none;
  opacity: 1;
  border-left: 2px solid transparent;
  margin-left: -2px;
  transition: all var(--transition);
}
.cat-side__link:hover {
  color: var(--white);
  border-left-color: var(--purple-3);
  background: rgba(108,71,255,0.06);
}
.cat-side__link span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--purple-3);
  background: rgba(108,71,255,0.12);
  border: 1px solid var(--purple-border);
  padding: 2px 8px;
  border-radius: 100px;
  opacity: 1;
}

/* --- cat-main: 主区垂直分区列表 --- */
.cat-main { display: flex; flex-direction: column; gap: 28px; }

/* --- cat-section: 分类卡片 head/list/more --- */
.cat-section {
  padding: 26px 28px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  scroll-margin-top: 88px;
  transition: border-color var(--transition);
}
.cat-section:hover { border-color: var(--purple-border); }

.cat-section__head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.cat-section__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.cat-section__title a {
  color: var(--white);
  text-decoration: none;
  transition: color var(--transition);
}
.cat-section__title a:hover { color: var(--purple-3); }
.cat-section__desc {
  font-size: 0.86rem;
  color: var(--white-60);
  line-height: 1.6;
  margin: 0;
}

.cat-section__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  counter-reset: catpost;
}
.cat-section__list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
  counter-increment: catpost;
  position: relative;
  padding-left: 28px;
}
.cat-section__list li:last-child { border-bottom: none; }
.cat-section__list li::before {
  content: counter(catpost, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 14px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--purple-3);
  font-family: var(--mono);
}

.cat-section__link {
  flex: 1;
  color: var(--white-80);
  text-decoration: none;
  transition: color var(--transition);
  min-width: 0;
}
.cat-section__link:hover { color: var(--purple-3); }
.cat-section__link:hover .cat-section__title-line { color: var(--purple-3); }

.cat-section__title-line {
  display: block;
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.4;
  transition: color var(--transition);
}
.cat-section__excerpt {
  display: block;
  font-size: 0.8rem;
  color: var(--white-40);
  line-height: 1.55;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.cat-section__date {
  font-size: 0.76rem;
  color: var(--white-40);
  white-space: nowrap;
  font-family: var(--mono);
  flex-shrink: 0;
}

.cat-section__more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--purple-3);
  text-decoration: none;
  transition: color var(--transition);
}
.cat-section__more:hover { color: var(--white); }

.cat-section__empty {
  padding: 24px;
  text-align: center;
  color: var(--white-40);
  font-size: 0.86rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.02);
}

@media (max-width: 640px) {
  .cat-section { padding: 20px 18px; }
  .cat-section__list li { flex-direction: column; align-items: flex-start; gap: 4px; padding-left: 24px; }
  .cat-section__date { align-self: flex-end; }
}

