/* ============================================================
   连载文章系统 · 文章页 / 目录页样式
   ============================================================ */

:root {
  --pc-brain: #46608c;
  --pc-employee: #b8432e;
  --pc-agent: #3f7d5d;
  --pc-geo: #a8742a;
  --pc-thinking: #6e4a6e;
}

/* ---------- 连载目录页 ---------- */
.series-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
/* 奇数张时：最后一张跨满两列，目录分两栏，避免"2+1 孤儿卡" */
.series-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.series-card:last-child:nth-child(odd) .series-toc { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 36px; }
.series-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 28px 26px; box-shadow: var(--shadow-sm);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s;
  display: flex; flex-direction: column; gap: 12px;
}
.series-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.series-head { display: flex; gap: 8px; align-items: center; }
.series-card h2 { font-size: 19px; line-height: 1.45; }
.series-card h2 a { color: var(--ink); }
.series-card h2 a:hover { color: var(--primary); }
.series-desc { font-size: 14px; color: var(--ink-2); line-height: 1.7; }
.series-toc { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.series-toc li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.series-toc li a { font-size: 14.5px; color: var(--ink-2); padding: 5px 8px; border-radius: 8px; transition: background 0.15s, color 0.15s; }
.series-toc li a:hover { background: var(--surface-2); color: var(--ink); }
.series-toc li time { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.series-toc li.cur a { background: var(--surface-2); color: var(--ink); font-weight: 700; }

/* ---------- 首页最新连载卡 ---------- */
.articles-teaser { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.article-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 24px 22px 20px; box-shadow: var(--shadow-sm); color: var(--ink);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s;
}
.article-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.article-card h3 { font-size: 17px; line-height: 1.5; }
.article-card p { font-size: 14px; color: var(--ink-2); flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-card .meta { font-size: 12.5px; color: var(--ink-3); border-top: 1px dashed var(--line); padding-top: 10px; }
.article-card:hover h3 { color: var(--primary); }

/* ---------- 文章页 ---------- */
.article { padding: 0 0 72px; }
.article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; }
.article-head { border-bottom: 1px solid var(--line); padding-bottom: 24px; margin-bottom: 28px; }
.series-chip { margin-bottom: 14px; }
.article-head h1 { font-size: clamp(26px, 3.6vw, 38px); font-weight: 800; line-height: 1.3; letter-spacing: -0.01em; }
.article-meta { margin-top: 12px; font-size: 13.5px; color: var(--ink-3); }
.article-summary {
  margin-top: 16px; padding: 16px 18px; border-left: 3px solid var(--seal);
  background: var(--surface-2); border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 15px; color: var(--ink-2); line-height: 1.8;
}

/* 正文排版 */
.article-body.md { font-size: 16.5px; line-height: 1.95; color: var(--ink); }
.md h2 { font-size: 23px; font-weight: 800; margin: 40px 0 14px; padding-left: 14px; border-left: 4px solid var(--seal); line-height: 1.4; }
.md h3 { font-size: 19px; font-weight: 700; margin: 30px 0 10px; }
.md h4 { font-size: 16.5px; font-weight: 700; margin: 24px 0 8px; }
.md p { margin: 12px 0; }
.md a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.md ul, .md ol { margin: 12px 0; padding-left: 6px; display: flex; flex-direction: column; gap: 6px; }
.md ul li { padding-left: 22px; position: relative; }
.md ul li::before { content: ""; position: absolute; left: 4px; top: 0.72em; width: 7px; height: 7px; border-radius: 50%; background: var(--seal); }
.md ol { counter-reset: oli; }
.md ol li { padding-left: 34px; position: relative; counter-increment: oli; }
.md ol li::before { content: counter(oli); position: absolute; left: 0; top: 0.18em; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); color: var(--seal); font-size: 12.5px; font-weight: 700; display: grid; place-items: center; }
.md blockquote { margin: 18px 0; padding: 14px 20px; background: var(--surface-2); border-left: 3px solid var(--primary); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--ink-2); }
.md code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 0.88em; font-family: Consolas, "Courier New", monospace; }
.md pre { background: #211c15; color: #f0e9d8; border-radius: var(--r-sm); padding: 18px 20px; overflow-x: auto; margin: 18px 0; font-size: 14px; line-height: 1.7; }
.md pre code { background: none; border: none; color: inherit; padding: 0; }
.md hr { border: none; border-top: 1px dashed var(--line); margin: 30px 0; }
.md strong { font-weight: 700; }
.md-table { overflow-x: auto; margin: 16px 0; }
.md table { border-collapse: collapse; width: 100%; font-size: 14.5px; background: var(--surface); }
.md th { background: var(--surface-2); font-weight: 700; text-align: left; }
.md th, .md td { border: 1px solid var(--line); padding: 9px 14px; line-height: 1.6; }

/* 上下篇 */
.article-pager { display: flex; justify-content: space-between; gap: 14px; margin-top: 48px; }
.article-pager a {
  flex: 1; max-width: 48%; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 16px 20px; box-shadow: var(--shadow-sm); color: var(--ink);
  transition: transform 0.2s, box-shadow 0.2s;
}
.article-pager a:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.article-pager .next { text-align: right; }
.article-pager span { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.article-pager b { font-size: 15px; line-height: 1.45; }

/* 侧栏目录 */
.article-aside { position: sticky; top: calc(var(--nav-h) + 24px); }
.toc-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 22px 20px; box-shadow: var(--shadow-sm);
}
.toc-card h3 { font-size: 15px; line-height: 1.55; margin-bottom: 12px; color: var(--ink); }
.toc-btn { margin-top: 14px; width: 100%; justify-content: center; font-size: 14px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .series-grid { grid-template-columns: 1fr; }
  .articles-teaser { grid-template-columns: repeat(2, 1fr); }
  .article-grid { grid-template-columns: 1fr; }
  .article-aside { position: static; order: -1; }
  .toc-card { background: var(--bg-soft); }
}
@media (max-width: 680px) {
  .articles-teaser { grid-template-columns: 1fr; }
  .article-pager { flex-direction: column; }
  .article-pager a { max-width: 100%; }
  .article-pager .next { text-align: left; }
}

/* ---------- 图文手册（幻灯式） ---------- */
.deck { display: flex; flex-direction: column; gap: 22px; }
.slide {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 44px 48px 36px; box-shadow: var(--shadow-md);
  min-height: 220px; position: relative; overflow: hidden;
  scroll-margin-top: calc(var(--nav-h) + 20px);
}
.slide::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 6px;
  background: linear-gradient(180deg, var(--pc, var(--seal)), color-mix(in srgb, var(--pc, var(--seal)) 30%, transparent));
}
.slide::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--pc, var(--seal)), transparent 70%);
}
.slide-no {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.12em;
  color: var(--pc, var(--seal));
  background: color-mix(in srgb, var(--pc, var(--seal)) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--pc, var(--seal)) 28%, transparent);
  border-radius: 999px; padding: 4px 12px; margin-bottom: 16px;
}
.slide h2 {
  font-size: clamp(21px, 2.6vw, 27px); font-weight: 800; line-height: 1.4;
  margin: 0 0 16px; padding-bottom: 12px; letter-spacing: -0.01em;
  border-bottom: 1px solid var(--line);
}
.slide .slide-body { font-size: 16.5px; line-height: 1.9; color: var(--ink); }
.slide .slide-body p { margin: 10px 0; }
.slide .slide-body ul, .slide .slide-body ol { margin: 10px 0; }
.slide .slide-body blockquote {
  margin: 18px 0 4px; padding: 18px 24px; text-align: center;
  background: color-mix(in srgb, var(--pc, var(--seal)) 7%, transparent);
  border: 1px dashed color-mix(in srgb, var(--pc, var(--seal)) 38%, transparent);
  border-radius: var(--r-md);
  font-size: 17.5px; font-weight: 600; color: var(--pc, var(--seal));
}
.slide .slide-body img {
  display: block; width: 100%; max-width: 720px; height: auto;
  margin: 14px auto 4px; border: 1px solid var(--line); border-radius: var(--r-md);
}

/* 图文课页头提示 */
.article-head .deck-hint {
  margin-top: 14px; font-size: 13px; color: var(--ink-3);
}

/* 图文课底部 CTA */
.deck-cta {
  margin-top: 40px; border: 1px solid var(--line); border-left: 4px solid var(--seal);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--surface); padding: 26px 28px;
}
.deck-cta h3 { font-size: 18px; margin-bottom: 8px; }
.deck-cta p { font-size: 14.5px; color: var(--ink-2); margin-bottom: 16px; line-height: 1.8; }
