/* biabalab.com — Docs / Posts / Category extra styles
   Compatibility shim：将 biabalab 旧 CSS 的变量名映射到 docs 模块需要的变量名
*/
:root {
  --bg-card: var(--surface, #1e1e30);
  --bg-card-hover: var(--surface2, #252540);
  --border-2: var(--border, #2e2e4a);
  --purple-1: var(--purple, #7c3aed);
  --purple-2: var(--purple2, #9333ea);
  --purple-3: var(--yellow, #f5c542);
  --purple-glow: rgba(124,58,237,0.25);
  --purple-border: rgba(124,58,237,0.35);
  --white: #ffffff;
  --white-80: rgba(255,255,255,0.80);
  --white-60: rgba(255,255,255,0.60);
  --white-40: rgba(255,255,255,0.40);
  --white-15: rgba(255,255,255,0.08);
  --text-muted: var(--text3, #9090aa);
}

/* ====== 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-C 补齐：通用 / Hero / Section / Container ============ */
/* 主色调：violet + amber（沿用站点 --purple #7c3aed / --yellow #f5c542） */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; box-sizing: border-box; }
@media (max-width: 768px) { .container { padding: 0 16px; } }

.gradient-text {
  background: linear-gradient(135deg, #a78bfa 0%, #f5c542 50%, #fbbf24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.section-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c4b5fd;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.28);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 14px;
}

.hero-desc {
  font-size: clamp(0.98rem, 2vw, 1.15rem);
  color: #b0adc9;
  max-width: 620px;
  margin: 0 auto 36px;
  line-height: 1.75;
}

.btn-hero-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 34px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed 0%, #9333ea 50%, #f5c542 130%);
  box-shadow: 0 8px 28px rgba(124, 58, 237, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  min-height: 52px;
  line-height: 1;
  white-space: nowrap;
}
.btn-hero-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(124, 58, 237, 0.55); }
.btn-hero-primary:active { transform: translateY(0); }

.btn-hero-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 32px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 14px;
  text-decoration: none;
  color: #e8e6f4;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(245, 197, 66, 0.32);
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
  min-height: 52px;
  line-height: 1;
  white-space: nowrap;
}
.btn-hero-secondary:hover {
  border-color: rgba(245, 197, 66, 0.7);
  background: rgba(245, 197, 66, 0.08);
  color: #fff;
}

/* viewall 链接补齐（如果已存在 .viewall a 则只是冗余安全声明） */
.viewall a { color: #c4b5fd; }
.viewall a:hover { color: #fbbf24; }

/* cat-cards 增强：编号与标题用紫金渐变 */
.cat-cards .cat-card { background: linear-gradient(180deg, rgba(124,58,237,0.05) 0%, rgba(255,255,255,0.02) 100%); border-color: rgba(124,58,237,0.18); }
.cat-cards .cat-card:hover { border-color: rgba(245,197,66,0.4); box-shadow: 0 10px 30px rgba(124,58,237,0.18); }
.cat-cards .cat-card__num { color: #f5c542; opacity: 0.18; }
.cat-cards .cat-card__title { color: #f3f0ff; }
.cat-cards .cat-card__list li::before { color: #a78bfa; opacity: 1; }

/* feed 列表：日期块使用站点渐变 */
.feed .feed__date {
  background: linear-gradient(160deg, rgba(124,58,237,0.18), rgba(245,197,66,0.10));
  border: 1px solid rgba(124,58,237,0.22);
  border-radius: 10px;
  padding: 8px 4px;
}
.feed .feed__day { color: #fbbf24; }
.feed .feed__ym { color: #b0adc9; opacity: 0.85; }
.feed .feed__title { color: #e8e6f4; }
.feed .feed__title:hover { color: #fbbf24; }
.feed .feed__chip {
  background: rgba(124,58,237,0.14);
  color: #c4b5fd;
  border: 1px solid rgba(124,58,237,0.28);
  opacity: 1;
}

/* 响应式 */
@media (max-width: 768px) {
  .btn-hero-primary, .btn-hero-secondary { padding: 13px 22px; font-size: 15px; min-height: 48px; width: 100%; }
  .hero-desc { font-size: 0.98rem; margin-bottom: 28px; }
  .section-tag { font-size: 11px; padding: 4px 12px; }
  .cat-cards { grid-template-columns: 1fr; gap: 14px; }
  .cat-card { padding: 20px; }
  .feed__item { grid-template-columns: 56px 1fr; gap: 12px; padding: 14px 0; }
  .feed__day { font-size: 20px; }
}
