/* ============================================================
   layout_L2.css — 长文型变体 L2「左侧目录侧栏型」专属布局层
   ------------------------------------------------------------
   输出结构：
     <div class="l2-wrap container">
       <div class="main-content">
         <div class="l2-toc">...</div>
         <section class="hero-v2">...</section>
         <section class="section">...</section>
         <div class="compact-download-row">...</div>
       </div>
     </div>
   说明：目录 float 左侧粘性定位，正文右侧自然流动。移动端退回顶部。
   ============================================================ */

.l2-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px;
}

.l2-wrap .main-content {
  min-width: 0;
}

.l2-wrap .main-content::after {
  content: "";
  display: table;
  clear: both;
}

/* 左侧目录卡 — float + sticky */
.l2-toc {
  float: left;
  width: 220px;
  background: var(--blue-50);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 18px 20px;
  position: sticky;
  top: 124px;
  max-height: calc(100vh - 148px);
  overflow-y: auto;
  margin-right: 0;
}

/* 所有 TOC 之后的兄弟元素推到右侧 */
.l2-toc ~ * {
  margin-left: 260px;
}

.l2-toc h3 {
  font-size: 14px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 11px;
}

.l2-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: l2toc;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.l2-toc li {
  counter-increment: l2toc;
  font-size: 13px;
  line-height: 1.5;
}

.l2-toc li::before {
  content: counter(l2toc);
  display: inline-flex;
  width: 20px;
  height: 20px;
  background: var(--blue);
  color: var(--white);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  flex-shrink: 0;
}

.l2-toc a {
  color: var(--gray-700);
  text-decoration: none;
}

.l2-toc a:hover {
  color: var(--blue);
}

@media (max-width: 768px) {
  .l2-toc {
    float: none;
    width: 100%;
    position: static;
    max-height: none;
    overflow-y: visible;
    margin-bottom: 20px;
  }
  .l2-toc ~ * {
    margin-left: 0;
  }
}
