/* ============================================================
   layout_L2.css — 长文型变体 L2「顶部目录型」专属布局层
   ------------------------------------------------------------
   配套渲染函数：layout_engine.render_L2_top_toc()
   输出结构：
     <div class="l2-wrap container">
       <div class="main-content">
         <div class="l2-toc"><h3>本文目录</h3><ol><li><a>..</a></li></ol></div>
         {body}
       </div>
     </div>
   说明：目录卡嵌入正文顶部（H1 之后），移动端不挤压正文。
   颜色/字体/圆角全部继承 seo_global.css 变量，零硬编码。
   ============================================================ */

.l2-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 32px 24px;
}

.l2-wrap .main-content {
  min-width: 0;
}

/* 顶部目录卡 */
.l2-toc {
  background: var(--blue-50);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 18px 22px;
  margin: 18px 0 26px;
}

.l2-toc h3 {
  font-size: 14px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 11px;
}

/* 目录项：2 列网格 + 数字编号 */
.l2-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: l2toc;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
}

.l2-toc li {
  counter-increment: l2toc;
  font-size: 13px;
}

.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;
}

.l2-toc a {
  color: var(--gray-700);
  text-decoration: none;
}

.l2-toc a:hover {
  color: var(--blue);
}

/* 响应式：移动端目录塌为单列 */
@media (max-width: 768px) {
  .l2-toc ol {
    grid-template-columns: 1fr;
  }
}

/* ── 长文内容排版 ── */
.l2-wrap h2 {
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
  margin: 40px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e2e8f0;
  line-height: 1.3;
}
.l2-wrap h2:first-of-type {
  margin-top: 8px;
}
.l2-wrap h3 {
  font-size: 17px;
  font-weight: 600;
  color: #334155;
  margin: 24px 0 12px;
}
.l2-wrap p {
  font-size: 15px;
  line-height: 1.85;
  color: #475569;
  margin: 0 0 16px;
}
.l2-wrap strong {
  color: #2563eb;
  font-weight: 600;
}
.l2-wrap .step-item {
  display: flex;
  gap: 16px;
  margin: 24px 0;
  padding: 16px 20px;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 4px solid #2563eb;
}
.l2-wrap .step-item strong {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: #2563eb;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.l2-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 16px 0;
}
.l2-wrap table td {
  padding: 8px 0;
  border-bottom: 1px solid #e5e7eb;
}
.l2-wrap table td:first-child {
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  padding-right: 16px;
  width: 180px;
}
.l2-wrap table td:last-child {
  color: #6b7280;
}
/* callout/warning box */
.l2-wrap div[style*="fef2f2"] {
  margin: 16px 0;
  border-radius: 4px;
}
/* step blocks */
.l2-wrap .steps-v2 {
  margin: 20px 0;
}
.l2-wrap .steps-v2 .step {
  margin: 16px 0;
  padding: 14px 18px;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 3px solid #2563eb;
}
