/* ==========================================================
   v1.1 SEO 增强样式：TAG 云 / 热门排行 / 自动内链 / 友链 / 面包屑
   按需引入：在文章详情 / TAG 聚合 / 案例详情等页面 extraCss 加上 seo-enhance.css
   ========================================================== */

/* --- 面包屑：多级适配 + 当前页加粗 --- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: 14px;
  color: var(--text-muted, #6b7280);
  padding: 14px 0 8px;
}
.breadcrumb a { color: var(--text-muted, #6b7280); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary, #b91c1c); }
.breadcrumb .breadcrumb-sep { margin: 0 8px; color: #cbd5e1; }
.breadcrumb .breadcrumb-current {
  color: var(--text, #111827);
  font-weight: 600;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 深蓝 Hero 内当前页：强制浅色，避免手机端看不见 */
.page-hero .breadcrumb .breadcrumb-current,
.articles-hero .breadcrumb .breadcrumb-current,
.cases-hero .breadcrumb .breadcrumb-current {
  color: #fff !important;
}

/* --- 自动内链（关键词 → 自动加 A 标签） --- */
.article-body .seo-auto-link {
  color: #0369a1;
  text-decoration: none;
  border-bottom: 1px dashed rgba(3, 105, 161, 0.4);
  background: rgba(56, 189, 248, 0.07);
  padding: 0 3px;
  border-radius: 3px;
  transition: background .2s, color .2s;
}
.article-body .seo-auto-link:hover {
  color: #075985;
  background: rgba(56, 189, 248, 0.18);
  border-bottom-style: solid;
}

/* --- 文章底部 TAG 区 --- */
.article-footer {
  padding-top: 32px;
  margin-top: 12px;
  border-top: 1px solid var(--border, #e5e7eb);
}
.article-footer > .article-tag-inner,
.article-footer > a.article-tag-inner {
  display: inline-block;
  font-size: 13px;
  line-height: 1.4;
  padding: 6px 12px;
  margin: 0 8px 10px 0;
  border-radius: 999px;
  background: #fef2f2;
  color: var(--primary, #b91c1c);
  text-decoration: none;
  border: 1px solid #fecaca;
}
.article-footer > a.article-tag-inner:hover {
  background: var(--primary, #b91c1c);
  color: #fff;
  border-color: var(--primary, #b91c1c);
}
.article-footer .article-disclaimer { margin-top: 18px; }

/* --- 侧边栏：卡片 + 排行榜 + TAG 云 --- */
.sidebar-widgets { display: flex; flex-direction: column; gap: 20px; }
.widget-card {
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  padding: 20px 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.widget-title {
  font-size: 17px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 14px;
  padding-left: 12px;
  position: relative;
}
.widget-title::before {
  content: '';
  position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 3px; border-radius: 3px;
  background: linear-gradient(180deg, var(--color-accent, #D4AF37), var(--color-accent-deep, #8B6914));
}
.rank-list {
  list-style: none; padding: 0; margin: 0;
  counter-reset: rank;
}
.rank-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px dashed #f1f5f9;
  font-size: 14px;
  line-height: 1.5;
}
.rank-list li:last-child { border-bottom: none; }
.rank-list .rank-idx {
  flex: 0 0 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  background: #f1f5f9;
  color: #64748b;
}
.rank-list li:nth-child(1) .rank-idx { background: var(--color-primary, #1A2332); color: #fff; }
.rank-list li:nth-child(2) .rank-idx { background: #2c3b52; color: #fff; }
.rank-list li:nth-child(3) .rank-idx { background: var(--color-accent, #D4AF37); color: #1a2332; }
.rank-list li > a {
  flex: 1;
  min-width: 0;
  color: #111827;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  transition: color .15s;
}
.rank-list li > a:hover { color: var(--color-accent-deep, #8B6914); }
.rank-list li em {
  font-style: normal;
  font-size: 12px;
  color: #94a3b8;
  background: #f8fafc;
  padding: 2px 8px;
  border-radius: 999px;
}

/* TAG 云（详情页侧边栏 + TAG 索引 / 聚合页）— 与品牌金/藏青统一 */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #e8edf3;
  background: #f8fafc;
  color: var(--text-body, #334155);
  font-size: 13px;
  text-decoration: none;
  transition: border-color .15s, background .15s, color .15s, transform .15s;
}
.tag-cloud-item:hover {
  background: #fffbeb;
  border-color: rgba(212, 175, 55, 0.55);
  color: var(--text-title, #1a2332);
  transform: translateY(-1px);
  box-shadow: none;
}
.tag-cloud-item.tag-s1,
.tag-cloud-item.size-1 { font-size: 12px; opacity: .9; }
.tag-cloud-item.tag-s2,
.tag-cloud-item.size-2 { font-size: 12.5px; }
.tag-cloud-item.tag-s3,
.tag-cloud-item.size-3 { font-size: 13.5px; }
.tag-cloud-item.tag-s4,
.tag-cloud-item.size-4 { font-size: 14.5px; font-weight: 650; }
.tag-cloud-item.tag-s5,
.tag-cloud-item.size-5 { font-size: 16px; font-weight: 700; }
.tag-cloud-item.tag-s6,
.tag-cloud-item.size-6 { font-size: 17.5px; font-weight: 800; }

/* 响应式：详情页相关区旧双栏兜底 */
@media (max-width: 768px) {
  .related-grid-wrap { grid-template-columns: 1fr !important; }
  .sidebar-widgets { order: 2; }
}

/* --- 友情链接（Footer） --- */
.footer-links {
  margin-top: 28px;
  padding: 22px 0 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.footer-links-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}
.footer-links-mark {
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: #d4af37;
  flex-shrink: 0;
}
.footer-links-head h5 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  color: rgba(255,255,255,.88);
}
.footer-links-sub {
  font-size: 12px;
  color: rgba(255,255,255,.38);
}
.footer-links-sub::before {
  content: "·";
  margin-right: 10px;
  color: rgba(255,255,255,.22);
}
.footer-links-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-links-list li { margin: 0; padding: 0; }
.footer-links-list a {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.78);
  font-size: 13px;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  transition: color .18s, border-color .18s, background .18s, transform .18s;
}
.footer-links-list a:hover {
  color: #fff;
  border-color: rgba(212,175,55,.45);
  background: rgba(212,175,55,.1);
  transform: translateY(-1px);
}

/* --- TAG 索引页：热门标签大区块 + 字母/热度分区头 --- */
.tag-section { padding: 28px 0 40px; }
.tag-section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 36px 0 18px;
}
.tag-section-title h2 {
  font-size: 22px; margin: 0; color: #0f172a; font-weight: 800;
}
.tag-section-title .sec-sub {
  color: #64748b; font-size: 14px;
}
.tag-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.tag-card {
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid #fecdd3;
  background: linear-gradient(135deg, #fff 0%, #fff5f5 100%);
  text-decoration: none;
  color: inherit;
  transition: all .2s ease;
  display: block;
}
.tag-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(185, 28, 28, 0.08);
  border-color: var(--primary, #b91c1c);
}
.tag-card .tag-card-title {
  font-size: 17px; font-weight: 700; color: #0f172a;
  display: flex; align-items: baseline; justify-content: space-between;
}
.tag-card .tag-card-title .count-badge {
  font-size: 12px; color: #94a3b8; font-weight: 500;
  background: #fff; padding: 2px 8px; border-radius: 999px;
}
.tag-card .tag-card-desc {
  margin-top: 8px; color: #64748b; font-size: 13px; line-height: 1.6;
}

/* --- HTML 站点地图：分区卡片 + 树 --- */
.sitemap-section { padding: 10px 0 26px; }
.sitemap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 16px;
}
.sitemap-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px 16px;
  transition: border-color .18s;
}
.sitemap-card:hover { border-color: var(--primary, #b91c1c); }
.sitemap-card h5 {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--primary, #b91c1c);
}
.sitemap-card h5 a {
  color: inherit; text-decoration: none;
}
.sitemap-card ul { list-style: none; padding: 0; margin: 0; }
.sitemap-card ul ul { padding-left: 14px; margin-top: 6px; }
.sitemap-card li {
  padding: 5px 0;
  font-size: 14px;
  border-bottom: 1px dashed #f1f5f9;
}
.sitemap-card li:last-child { border-bottom: none; }
.sitemap-card li a {
  color: #1f2937;
  text-decoration: none;
  transition: color .15s;
}
.sitemap-card li a:hover { color: var(--primary, #b91c1c); }
.sitemap-card li.cat-head > a { font-weight: 600; color: #0f172a; }
.sitemap-card .quick-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  margin-right: 8px; border-radius: 8px;
  background: #fef2f2; color: var(--primary, #b91c1c);
  font-size: 16px;
}

/* ========== 法条 / 术语悬停链接样式（蓝绿虚线） ========== */
.statute-pop,
.glossary-pop {
  text-decoration: none;
  border-bottom: 1px dashed #0ea5e9;
  color: #0369a1;
  font-weight: 500;
  cursor: pointer;
  transition: all .18s ease;
  padding: 0 2px;
  border-radius: 3px;
}
.statute-pop:hover,
.statute-pop:focus-visible {
  color: #fff;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(14,165,233,.28);
  outline: none;
}
.glossary-pop {
  border-bottom-color: #10b981;
  color: #047857;
}
.glossary-pop:hover,
.glossary-pop:focus-visible {
  color: #fff;
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(16,185,129,.28);
  outline: none;
}
a.statute-pop, a.glossary-pop {
  color: inherit;
}
@media (max-width: 640px) {
  .statute-pop, .glossary-pop {
    border-bottom-width: 2px;
    padding-bottom: 1px;
  }
}

/* ========== 法条库 Tab 页面 ========== */
.statute-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  padding: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  flex-wrap: wrap;
}
.statute-tab {
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  transition: all .2s;
  flex-shrink: 0;
}
.statute-tab:hover {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(15,23,42,.06);
}
.statute-tab.active {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #fff;
  box-shadow: 0 4px 14px rgba(14,165,233,.28);
}
.statute-cat-title {
  padding: 10px 14px;
  margin: 20px 0 10px;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}
.statute-cat-title::before {
  content: "§";
  color: #0ea5e9;
  font-weight: 800;
}
.statute-list-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}
.statute-list-table th {
  text-align: left;
  padding: 10px 14px;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: .04em;
  border-bottom: 1px solid #e5e7eb;
}
.statute-list-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
  color: #334155;
  line-height: 1.55;
}
.statute-list-table tr:last-child td { border-bottom: none; }
.statute-list-table tr:hover td { background: #f8fafc; }
.statute-art-no {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
}
.statute-title-cell { font-weight: 600; color: #0f172a; cursor: pointer; }
.statute-title-cell:hover { color: #0369a1; }

/* ========== 术语表 A-Z 索引 ========== */
.glossary-az {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 18px;
}
.glossary-az a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  text-decoration: none;
  transition: all .15s;
}
.glossary-az a:hover {
  background: #ecfdf5;
  color: #047857;
}
.glossary-az a.active {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 3px 10px rgba(16,185,129,.24);
}
.glossary-cat-group { margin-bottom: 28px; }
.glossary-cat-h {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 1px solid #a7f3d0;
  border-radius: 12px;
  margin-bottom: 12px;
}
.glossary-cat-h::before {
  content: "◆";
  color: #059669;
}
.glossary-cat-h h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #065f46;
}
.glossary-cat-h span {
  margin-left: auto;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fff;
  color: #047857;
  font-weight: 700;
}

/* ========== 术语卡片网格 ========== */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.glossary-grid > a:hover {
  box-shadow: 0 12px 28px rgba(16,185,129,.1);
  border-color: #10b981 !important;
  transform: translateY(-3px);
}

/* ========== 通用：隐藏空容器 ========== */
.statute-list-table:empty, .glossary-grid:empty { display: none; }

/* ========== 刑事诉讼流程页 ========== */
.proc-hero-title {
  font-size: clamp(26px, 5vw, 38px);
  margin-bottom: 14px;
  color: #fff;
}
.proc-timeline {
  position: relative;
  background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 10px 20px;
  margin-bottom: 28px;
  overflow-x: auto;
}
.proc-timeline-track {
  position: absolute;
  left: 20px;
  right: 20px;
  top: 45px;
  height: 3px;
  background: linear-gradient(90deg, #fecaca, #f87171, #ef4444, #dc2626, #b91c1c, #7f1d1d, #450a0a, #166534);
  border-radius: 999px;
}
.proc-timeline-row {
  display: flex;
  gap: 0;
  min-width: 900px;
}
.proc-tl-item {
  flex: 1;
  min-width: 0;
  position: relative;
  text-align: center;
  padding: 20px 10px 10px;
  cursor: pointer;
}
.proc-tl-idx {
  width: 46px;
  height: 46px;
  line-height: 46px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #e5e7eb;
  color: #64748b;
  font-weight: 800;
  font-size: 16px;
  margin: 0 auto 10px;
  position: relative;
  z-index: 2;
  text-align: center;
}
.proc-tl-item.open .proc-tl-idx,
.proc-tl-item:hover .proc-tl-idx {
  border-color: #dc2626;
  color: #b91c1c;
}
.proc-tl-title {
  font-weight: 700;
  font-size: 14px;
  color: #1f2937;
  line-height: 1.3;
  white-space: normal;
}
.proc-tl-period {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
  white-space: normal;
}
.proc-special-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 40px 0;
}

@media (max-width: 768px) {
  .proc-timeline {
    overflow: visible;
    padding: 16px 14px;
  }
  .proc-timeline-track {
    left: 36px;
    right: auto;
    top: 24px;
    bottom: 24px;
    width: 3px;
    height: auto;
    background: linear-gradient(180deg, #fecaca, #ef4444, #7f1d1d, #166534);
  }
  .proc-timeline-row {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 0;
  }
  .proc-tl-item {
    display: grid;
    grid-template-columns: 48px 1fr;
    grid-template-rows: auto auto;
    column-gap: 12px;
    text-align: left;
    padding: 12px 4px;
  }
  .proc-tl-idx {
    grid-row: 1 / span 2;
    align-self: center;
    margin: 0;
  }
  .proc-tl-title { font-size: 15px; }
  .proc-tl-period { margin-top: 2px; }
  .proc-special-grid {
    grid-template-columns: 1fr;
    margin: 28px 0;
  }
  .proc-card [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

