/* 案例检索 · 多页阅读站 */
:root {
  --bg: #f0f4fa;
  --bg-warm: #faf8f5;
  --surface: #ffffff;
  --text: #1c2333;
  --muted: #5a6578;
  --border: #dde3ee;
  --accent: #2563eb;
  --accent-2: #7c3aed;
  --accent-soft: #dbeafe;
  --gold: #d97706;
  --gold-soft: #fef3c7;
  --teal: #0d9488;
  --teal-soft: #ccfbf1;
  --rose: #e11d48;
  --rose-soft: #ffe4e6;
  --shadow: 0 4px 24px rgba(28, 35, 51, 0.06);
  --radius: 14px;
  --nav-w: 240px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --font-serif: "Source Han Serif SC", "Noto Serif SC", "Songti SC", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  background: linear-gradient(165deg, var(--bg) 0%, var(--bg-warm) 45%, #eef2ff 100%);
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  font-size: 0.88em;
  background: #f1f5f9;
  padding: 0.12em 0.4em;
  border-radius: 5px;
  color: #4338ca;
}

/* 顶栏 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.logo-link {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.logo-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.header-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
}

.hero-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-soft), #ede9fe);
  color: var(--accent);
}

.tagline {
  margin: 0;
  width: 100%;
  font-size: 0.85rem;
  color: var(--muted);
}

.header-tools input {
  width: min(260px, 70vw);
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  background: var(--surface);
}

.header-tools input:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

/* 布局 */
.layout {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
  gap: 2rem;
}

.side-nav {
  position: sticky;
  top: 5.25rem;
  align-self: flex-start;
  width: var(--nav-w);
  flex-shrink: 0;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  padding: 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.nav-heading {
  margin: 0 0 0.5rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

.side-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  margin: 0.15rem 0;
  font-size: 0.88rem;
  color: var(--muted);
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.side-nav a:hover {
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

.side-nav a.active {
  background: linear-gradient(90deg, var(--accent-soft), #f5f3ff);
  color: var(--accent);
  font-weight: 600;
}

.side-nav .nav-num {
  font-size: 0.7rem;
  font-weight: 700;
  opacity: 0.55;
  min-width: 1.4rem;
}

.side-nav .nav-home {
  font-weight: 600;
  color: var(--text);
}

/* 正文 */
.main {
  flex: 1;
  min-width: 0;
}

.page-hero {
  margin-bottom: 1.75rem;
  padding: 1.75rem 2rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #1e3a8a 0%, #4f46e5 50%, #7c3aed 100%);
  color: #fff;
  box-shadow: var(--shadow);
}

.page-hero h1 {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.35;
}

.page-sub {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.9;
  line-height: 1.5;
}

.article-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow);
}

.article-body > h2:first-child {
  margin-top: 0;
}

.article-body h2 {
  font-size: 1.35rem;
  margin: 2.25rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 3px solid var(--accent-soft);
  color: #1e3a8a;
}

.article-body h2:first-of-type {
  margin-top: 0;
}

.article-body h3 {
  font-size: 1.12rem;
  margin: 1.75rem 0 0.75rem;
  color: var(--accent-2);
}

.article-body h4 {
  font-size: 1rem;
  margin: 1.25rem 0 0.5rem;
  color: var(--teal);
}

/* 示例报告中的案例标题 */
.article-body h4:has(+ p strong) {
  padding: 0.65rem 0.85rem;
  background: linear-gradient(90deg, var(--rose-soft), #fff);
  border-radius: 8px;
  border-left: 3px solid var(--rose);
  color: #9f1239;
}

.article-body p {
  margin: 0 0 1rem;
}

.lead-label {
  font-weight: 600;
  color: var(--text);
}

.content-list {
  margin: 0 0 1.25rem;
  padding-left: 1.35rem;
}

.content-list li {
  margin: 0.35rem 0;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0.4rem 0;
  padding: 0.5rem 0.75rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px dashed var(--border);
  cursor: default;
}

.check-item input {
  margin-top: 0.35rem;
  accent-color: var(--accent);
}

.section-divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 2rem 0;
}

/* 提示框 */
.callout {
  margin: 1.25rem 0;
  padding: 1.1rem 1.25rem;
  border-radius: 12px;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  font-size: 0.95rem;
  line-height: 1.65;
}

.callout-warn {
  border-left-color: var(--gold);
  background: var(--gold-soft);
}

.callout-note {
  border-left-color: var(--teal);
  background: var(--teal-soft);
}

/* 表格 */
.table-wrap {
  overflow-x: auto;
  margin: 1.25rem 0;
  border-radius: 10px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

th {
  background: linear-gradient(180deg, #eff6ff, #e0e7ff);
  font-weight: 600;
  color: #1e40af;
}

tbody tr:nth-child(even) td {
  background: #fafbff;
}

tbody tr:hover td {
  background: #f0f9ff;
}

pre {
  margin: 1.25rem 0;
  padding: 1.1rem 1.25rem;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.55;
}

pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* 总览章节卡片 */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.chapter-card {
  display: block;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow);
}

.chapter-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.12);
  text-decoration: none;
}

.chapter-card h3 {
  margin: 0.5rem 0 0.35rem;
  font-size: 1.05rem;
  color: var(--text);
}

.chapter-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.ch-num {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  color: #fff;
}

.chapter-card.c1 { background: linear-gradient(145deg, #fff, #eff6ff); }
.chapter-card.c1 .ch-num { background: #2563eb; }
.chapter-card.c2 { background: linear-gradient(145deg, #fff, #ecfdf5); }
.chapter-card.c2 .ch-num { background: #059669; }
.chapter-card.c3 { background: linear-gradient(145deg, #fff, #fef3c7); }
.chapter-card.c3 .ch-num { background: #d97706; }
.chapter-card.c4 { background: linear-gradient(145deg, #fff, #fce7f3); }
.chapter-card.c4 .ch-num { background: #db2777; }
.chapter-card.c5 { background: linear-gradient(145deg, #fff, #ede9fe); }
.chapter-card.c5 .ch-num { background: #7c3aed; }
.chapter-card.c6 { background: linear-gradient(145deg, #fff, #e0f2fe); }
.chapter-card.c6 .ch-num { background: #0284c7; }
.chapter-card.c7 { background: linear-gradient(145deg, #fff, #fae8ff); }
.chapter-card.c7 .ch-num { background: #a21caf; }
.chapter-card.c8 { background: linear-gradient(145deg, #fff, #ffe4e6); }
.chapter-card.c8 .ch-num { background: #e11d48; }

.flow-strip {
  margin: 0 0 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.flow-strip h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: var(--muted);
}

.flow-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-weight: 600;
  color: var(--accent);
}

.flow-steps em {
  font-style: normal;
  color: var(--muted);
  font-weight: 400;
}

/* 翻页 */
.chapter-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.chapter-pager a {
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  background: var(--accent-soft);
  text-decoration: none;
}

.chapter-pager a:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

.pager-home {
  background: transparent !important;
  border: 1px dashed var(--border);
  color: var(--muted) !important;
}

.pager-disabled {
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1.25rem 1.5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  font-size: 0.85rem;
  color: var(--muted);
}

.hidden-by-search {
  display: none !important;
}

mark.search-hit {
  background: #fde047;
  padding: 0 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .layout {
    flex-direction: column;
    padding-top: 1rem;
  }

  .side-nav {
    position: relative;
    top: 0;
    width: 100%;
    max-height: none;
  }

  .side-nav ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.25rem;
  }

  .article-body {
    padding: 1.25rem 1.1rem;
  }

  .page-hero {
    padding: 1.25rem 1.35rem;
  }
}

/* ========== 法律技能库 · 统一门户 ========== */
:root {
  --nav-w: 280px;
}

.portal-header .header-brand {
  flex-wrap: wrap;
  align-items: center;
}

.portal-logo {
  font-weight: 800;
  color: #1e3a8a !important;
}

.skill-crumb {
  font-size: 1.05rem;
  font-weight: 600;
}

.header-sep {
  color: var(--muted);
  margin: 0 0.25rem;
  user-select: none;
}

.portal-layout .side-nav {
  width: var(--nav-w);
}

.skill-nav {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.skill-nav .nav-cat {
  margin: 0.65rem 0 0.25rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  list-style: none;
}

.skill-nav a.skill-link {
  display: block;
  padding: 0.38rem 0.6rem;
  margin: 0.1rem 0;
  font-size: 0.86rem;
  color: var(--muted);
  border-radius: 8px;
  text-decoration: none;
}

.skill-nav a.skill-link:hover {
  background: #f0f9ff;
  color: var(--accent);
  text-decoration: none;
}

.skill-nav a.skill-active,
.skill-nav a.portal-home.skill-active {
  background: linear-gradient(90deg, var(--accent-soft), #f5f3ff);
  color: var(--accent);
  font-weight: 600;
}

.nav-heading-chapters {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}

.chapter-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.chapter-nav a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  margin: 0.12rem 0;
  font-size: 0.86rem;
  color: var(--muted);
  border-radius: 8px;
  text-decoration: none;
}

.chapter-nav a:hover {
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

.chapter-nav a.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* 门户首页 */
.portal-hero {
  max-width: 1100px;
  margin: 1.5rem auto 1.25rem;
  padding: 2rem 2.25rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #1e3a8a 0%, #4f46e5 45%, #7c3aed 100%);
  color: #fff;
  box-shadow: var(--shadow);
}

.portal-hero h1 {
  margin: 0 0 0.6rem;
  font-size: 1.85rem;
}

.portal-hero p {
  margin: 0;
  line-height: 1.65;
  opacity: 0.92;
  font-size: 0.98rem;
}

.portal-main {
  max-width: 1100px;
  margin: 0 auto 3rem;
  padding: 0 1.25rem;
}

.portal-category {
  margin-bottom: 2rem;
}

.portal-category h2 {
  font-size: 1.15rem;
  color: #1e40af;
  margin: 0 0 0.85rem;
  padding-left: 0.5rem;
  border-left: 4px solid var(--accent);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.hub-card {
  display: block;
  padding: 1.2rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.hub-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.12);
  text-decoration: none;
}

.hub-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.08rem;
  color: #1e3a8a;
}

.hub-card .meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.hub-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.portal-footer {
  justify-content: center;
}

.hub-card.hidden-by-search {
  display: none !important;
}

@media (max-width: 900px) {
  .portal-layout .side-nav {
    width: 100%;
  }
}
