/* 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 Block（首页教程栏目分块） ====== */
.cat-list { display: grid; gap: 32px; max-width: 1100px; margin: 0 auto; }
.cat-block { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; padding: 24px 28px; }
.cat-block__head { margin-bottom: 16px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.cat-block__title { font-size: 22px; font-weight: 700; margin: 0; }
.cat-block__title a { color: inherit; text-decoration: none; }
.cat-block__desc { color: rgba(255,255,255,0.65); font-size: 14px; margin: 4px 0 0; flex-basis: 100%; }
.cat-block__more { font-size: 13px; color: var(--accent, #7c5cff); text-decoration: none; }
.cat-block__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.cat-block__item { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 8px 0; border-bottom: 1px dashed rgba(255,255,255,0.06); }
.cat-block__item:last-child { border-bottom: none; }
.cat-block__link { color: rgba(255,255,255,0.9); text-decoration: none; font-size: 15px; }
.cat-block__date { color: rgba(255,255,255,0.45); font-size: 12px; white-space: nowrap; }

/* === V-D: Accordion + List === */
.cat-accord { display: flex; flex-direction: column; gap: 8px; }
.cat-acc__item { border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; background: rgba(255,255,255,0.02); overflow: hidden; transition: border-color 0.15s; }
.cat-acc__item[open] { border-color: var(--accent, #7c5cff); }
.cat-acc__sum { padding: 16px 22px; cursor: pointer; display: flex; align-items: center; gap: 12px; list-style: none; user-select: none; }
.cat-acc__sum::-webkit-details-marker { display: none; }
.cat-acc__name { flex: 1; font-size: 16px; font-weight: 600; }
.cat-acc__count { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: rgba(255,255,255,0.08); opacity: 0.8; }
.cat-acc__chev { font-size: 18px; opacity: 0.5; transform: rotate(90deg); transition: transform 0.2s; }
.cat-acc__item[open] .cat-acc__chev { transform: rotate(270deg); }
.cat-acc__body { padding: 0 22px 18px 22px; border-top: 1px dashed rgba(255,255,255,0.06); }
.cat-acc__desc { font-size: 13px; opacity: 0.65; margin: 14px 0 14px; }
.cat-acc__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.cat-acc__list li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 8px; border-bottom: 1px dashed rgba(255,255,255,0.04); }
.cat-acc__list li:last-child { border-bottom: none; }
.cat-acc__link { color: inherit; text-decoration: none; font-size: 14px; flex: 1; }
.cat-acc__link:hover { color: var(--accent, #7c5cff); }
.cat-acc__date { font-size: 11px; opacity: 0.45; white-space: nowrap; }
.cat-acc__more { margin-top: 14px; font-size: 13px; opacity: 0.85; }
.cat-acc__more a { text-decoration: none; color: inherit; }
.cat-acc__more a:hover { color: var(--accent, #7c5cff); }
.cat-acc__empty { padding: 22px; text-align: center; opacity: 0.5; font-size: 13px; }

/* ============================================================
   bianio.com — Theme variable bridge
   docs.css 原引用紫色站点变量，这里映射到本站 red/dark-red 主题
   ============================================================ */
:root {
  --purple-1: var(--red-dark);
  --purple-3: var(--red);
  --purple-border: rgba(196,18,48,0.35);
  --white-15: rgba(255,255,255,0.10);
  --white-40: var(--text-dim);
  --white-60: var(--text-muted);
  --white-80: var(--text);
  --bg-3: var(--bg-card2);
  --bg-card-hover: #210608;
  --border-2: var(--border);
  --transition: 0.2s ease;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ============================================================
   Container（基础容器，主 CSS 未定义）
   ============================================================ */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* ============================================================
   Section Header（教程区块顶部标题组）
   ============================================================ */
.section-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 48px;
}
.section-header h2 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  line-height: 1.18;
  color: var(--white);
  letter-spacing: -0.6px;
  margin: 8px 0 14px;
}
.section-header p {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 620px;
  margin: 0 auto;
}
.gradient-text {
  background: linear-gradient(135deg, var(--red) 0%, #ff5a78 60%, #ffa090 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
  padding: 0 4px;
}

/* ============================================================
   Cat Cards（首页教程栏目卡片网格 V-C）
   ============================================================ */
.cat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
  max-width: 1160px;
  margin: 0 auto;
}
.cat-card {
  display: block;
  position: relative;
  padding: 26px 24px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: border-color .2s, transform .2s, box-shadow .2s, background .2s;
}
.cat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(196,18,48,0.14), transparent 60%);
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}
.cat-card:hover {
  border-color: rgba(196,18,48,0.45);
  background: var(--bg-card2);
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(196,18,48,0.18);
}
.cat-card:hover::before { opacity: 1; }
.cat-card__num {
  font-size: 12px;
  font-weight: 800;
  color: var(--red);
  letter-spacing: 0.12em;
  margin-bottom: 10px;
  font-feature-settings: 'tnum';
}
.cat-card__title {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--white);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
  line-height: 1.35;
}
.cat-card__desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 14px;
}
.cat-card__list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  border-top: 1px dashed rgba(196,18,48,0.18);
  padding-top: 12px;
}
.cat-card__list li {
  position: relative;
  font-size: 0.85rem;
  color: var(--text);
  padding: 5px 0 5px 16px;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cat-card__list li::before {
  content: '›';
  position: absolute;
  left: 2px;
  top: 4px;
  color: var(--red);
  font-weight: 700;
}
.cat-card__count {
  margin-top: 14px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 0.02em;
}
.cat-card__count--empty {
  color: var(--text-dim);
  font-weight: 600;
}

/* ============================================================
   Feed（首页全局最新 20 信息流）
   ============================================================ */
.feed {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 880px;
  margin: 0 auto;
  border-top: 1px solid var(--border);
}
.feed__item {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 22px;
  padding: 22px 4px;
  border-bottom: 1px solid var(--border);
  transition: background .2s;
}
.feed__item:hover { background: rgba(196,18,48,0.04); }
.feed__date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 6px;
  height: fit-content;
  align-self: start;
}
.feed__day {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--red);
  line-height: 1;
  letter-spacing: -0.02em;
  font-feature-settings: 'tnum';
}
.feed__ym {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 4px;
  letter-spacing: 0.04em;
  font-feature-settings: 'tnum';
}
.feed__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.feed__title {
  display: inline-block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.4;
  letter-spacing: -0.01em;
  transition: color .2s;
}
.feed__title:hover { color: var(--red); }
.feed__desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.feed__chip {
  display: inline-block;
  align-self: flex-start;
  margin-top: 4px;
  padding: 3px 10px;
  background: rgba(196,18,48,0.12);
  border: 1px solid rgba(196,18,48,0.3);
  color: var(--red);
  border-radius: 100px;
  font-size: 0.74rem;
  font-weight: 600;
}
@media (max-width: 640px) {
  .feed__item { grid-template-columns: 64px 1fr; gap: 14px; padding: 18px 2px; }
  .feed__day { font-size: 1.25rem; }
  .feed__title { font-size: 0.98rem; }
}
