/* biabaweb.com — Docs / Posts / Category extra styles
   适配亮色绿色主题（沿用 xhmfkwpqnt.css 的 #16a34a / #22c55e 绿系）
   通过变量映射覆盖 babianai 暗色变量，复用其 docs 结构样式
*/

/* 绿色亮色变量映射（覆盖原暗色紫色变量） */
:root {
  --purple-1: #16a34a;
  --purple-2: #15803d;
  --purple-3: #16a34a;
  --purple-border: rgba(22, 163, 74, 0.32);
  --bg-card: #ffffff;
  --bg-card-hover: #f0fdf4;
  --bg-2: #f9fafb;
  --bg-3: #f3f4f6;
  --border-2: #e3e3e8;
  --text: #1c1e21;
  --white: #1c1e21;
  --white-80: #2d3036;
  --white-60: #525860;
  --white-40: #71757f;
  --white-15: rgba(22, 163, 74, 0.08);
  --transition: .15s ease;
  --radius: 8px;
  --radius-lg: 12px;
  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* ====== 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); }

/* Home cat-block list */
.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-C: Cards Grid + Feed === */
.cat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; max-width: 1200px; margin: 0 auto; }
.cat-card { display: block; padding: 24px; border-radius: 16px; background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.06); text-decoration: none; color: inherit; position: relative; transition: transform 0.15s, border-color 0.15s; overflow: hidden; }
.cat-card:hover { transform: translateY(-3px); border-color: var(--accent, #7c5cff); }
.cat-card__num { position: absolute; top: 16px; right: 18px; font-size: 36px; font-weight: 900; opacity: 0.1; line-height: 1; }
.cat-card__title { font-size: 20px; font-weight: 700; margin: 0 0 8px; }
.cat-card__desc { font-size: 13px; opacity: 0.65; margin: 0 0 16px; line-height: 1.5; }
.cat-card__list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.cat-card__list li { font-size: 13px; opacity: 0.85; padding-left: 14px; position: relative; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-card__list li::before { content: '›'; position: absolute; left: 0; opacity: 0.5; }
.cat-card__count { font-size: 12px; opacity: 0.7; }
.cat-card__count--empty { opacity: 0.4; }
.feed { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 4px; }
.feed__item { display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding: 18px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.feed__item:last-child { border-bottom: none; }
.feed__date { display: flex; flex-direction: column; align-items: center; padding-top: 4px; line-height: 1; }
.feed__day { font-size: 24px; font-weight: 700; }
.feed__ym { font-size: 11px; opacity: 0.5; margin-top: 4px; }
.feed__body { display: flex; flex-direction: column; gap: 6px; }
.feed__title { font-size: 16px; font-weight: 600; text-decoration: none; color: inherit; }
.feed__title:hover { color: var(--accent, #7c5cff); }
.feed__desc { font-size: 13px; opacity: 0.65; margin: 0; line-height: 1.5; }
.feed__chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,0.06); align-self: flex-start; opacity: 0.7; }

/* =========================================================
   S3 / V-C 补齐：通用容器 + 渐变文字 + 按钮 + TOC 层级
   绿色亮色主调（独立色：emerald #16a34a→#10b981 双绿渐变）
   ========================================================= */

/* ---- Container ---- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  box-sizing: border-box;
}

/* ---- Gradient Text（绿系双色渐变，与紫色站点错开） ---- */
.gradient-text {
  background: linear-gradient(90deg, #16a34a 0%, #10b981 50%, #22c55e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  display: inline-block;
}

/* ---- 基础 btn（404 等使用） ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
  line-height: 1.2;
}
.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
  border-radius: 10px;
}

/* ---- TOC 层级补充（原仅 lv3，补 lv2/lv4） ---- */
.toc__item--lv2 a { padding-left: 0; font-size: 0.92rem; color: var(--white-80); font-weight: 600; }
.toc__item--lv4 a { padding-left: 24px; font-size: 0.78rem; color: var(--white-40); }

/* =========================================================
   V-C 配色覆盖（亮色绿系，覆盖原 dark+purple 默认值）
   ========================================================= */

/* cat-cards 网格容器（保留布局，加白底卡片视觉） */
.cat-cards {
  margin-top: 8px;
}
.cat-card {
  background: #ffffff;
  border: 1px solid #e3e3e8;
  box-shadow: 0 1px 2px rgba(20, 90, 50, 0.04);
}
.cat-card:hover {
  border-color: #16a34a;
  background: #f0fdf4;
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.12);
}
.cat-card__num {
  color: #16a34a;
  opacity: 0.14;
}
.cat-card__title {
  color: #14532d;
}
.cat-card__desc {
  color: #525860;
  opacity: 1;
}
.cat-card__list li {
  color: #2d3036;
  opacity: 1;
}
.cat-card__list li::before {
  color: #16a34a;
  opacity: 1;
}
.cat-card__count {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.10);
  color: #15803d;
  font-weight: 600;
  opacity: 1;
}
.cat-card__count--empty {
  background: rgba(0, 0, 0, 0.04);
  color: #71757f;
  opacity: 1;
}

/* feed 信息流（白底分隔线 + 绿色 hover） */
.feed {
  max-width: 760px;
}
.feed__item {
  border-bottom: 1px solid #e3e3e8;
  padding: 20px 4px;
}
.feed__item:hover {
  background: #f9fafb;
}
.feed__date {
  background: linear-gradient(180deg, #16a34a 0%, #15803d 100%);
  color: #fff;
  border-radius: 8px;
  padding: 10px 0;
  width: 64px;
}
.feed__day {
  color: #fff;
}
.feed__ym {
  color: rgba(255, 255, 255, 0.85);
  opacity: 1;
}
.feed__title {
  color: #1c1e21;
  font-size: 1rem;
}
.feed__title:hover {
  color: #16a34a;
}
.feed__desc {
  color: #525860;
  opacity: 1;
}
.feed__chip {
  background: rgba(22, 163, 74, 0.10);
  color: #15803d;
  opacity: 1;
  font-weight: 500;
}

/* =========================================================
   响应式（≤768px）
   ========================================================= */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  .cat-cards {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .cat-card {
    padding: 18px;
  }
  .cat-card__title {
    font-size: 18px;
  }
  .cat-card__num {
    font-size: 28px;
  }
  .feed__item {
    grid-template-columns: 52px 1fr;
    gap: 12px;
    padding: 16px 4px;
  }
  .feed__date {
    width: 52px;
    padding: 8px 0;
  }
  .feed__day {
    font-size: 20px;
  }
  .feed__ym {
    font-size: 10px;
  }
  .feed__title {
    font-size: 0.95rem;
  }
  .feed__desc {
    font-size: 0.82rem;
  }
  .btn-lg {
    padding: 12px 22px;
    font-size: 1rem;
  }
  .gradient-text {
    background-size: 100% 100%;
  }
}
