/* ============================================================
   NetCorePpt — examples_docs pages
   Shared styling for the demo-doc hub and the per-module pages.
   Depends on css/style.css (design tokens) being loaded first.
   ============================================================ */

.docs-page main { padding-top: calc(var(--header-h) + 8px); }

/* ---------- Hero ---------- */
.docs-hero {
  position: relative;
  overflow: hidden;
  padding: 52px 0 40px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(900px 340px at 85% -60px, rgba(139,92,246,.16), transparent 60%),
    radial-gradient(700px 300px at -10% 110%, rgba(249,115,22,.08), transparent 55%),
    var(--bg);
}
.docs-breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  font-size: 13.5px; color: var(--slate-500); margin-bottom: 14px;
}
.docs-breadcrumb a:hover { color: var(--violet-700); }
.docs-breadcrumb .sep { color: var(--slate-300); }
.docs-breadcrumb .cur { color: var(--violet-700); font-weight: 600; }
.docs-title {
  font-size: clamp(28px, 3.6vw, 40px); font-weight: 800; letter-spacing: -.02em;
  color: var(--slate-900); line-height: 1.15;
}
.docs-lead { margin-top: 12px; max-width: 860px; color: var(--text-muted); font-size: 17px; }
.docs-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.docs-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 14px; font-size: 13px; color: var(--slate-600);
  box-shadow: var(--shadow-sm);
}
.docs-chip b { color: var(--slate-900); font-weight: 600; }
.docs-chip code { font-size: 12px; color: var(--violet-700); }
.docs-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--violet-500); }
/* Source-file chip links to examples_docs/Modules/<Demo>.cs — dashed underline signals "openable" */
.docs-chip a.src-link { text-decoration: none; }
.docs-chip a.src-link code {
  border-bottom: 1px dashed rgba(109,40,217,.5);
  padding-bottom: 1px;
}
.docs-chip a.src-link:hover code { border-bottom-style: solid; }
.docs-chip a.src-link:focus-visible { outline: 2px solid var(--violet-500); outline-offset: 2px; border-radius: 4px; }

/* ---------- Body layout ---------- */
.docs-container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.docs-section { padding: 42px 0 8px; }
.docs-h2 {
  font-size: 22px; font-weight: 700; letter-spacing: -.01em; color: var(--slate-900);
  display: flex; align-items: center; gap: 10px;
}
.docs-h2 .no {
  display: inline-grid; place-items: center; width: 26px; height: 26px;
  border-radius: 8px; background: var(--violet-100); color: var(--violet-700);
  font-size: 13px; font-weight: 800; flex: none;
}
.docs-h2 small { font-weight: 500; color: var(--slate-400); font-size: 14px; }
.docs-section > p, .docs-section > .docs-p { margin-top: 14px; color: var(--slate-600); font-size: 15.5px; line-height: 1.75; }
.docs-callout {
  margin-top: 16px; border: 1px solid var(--violet-100); background: var(--violet-50);
  border-radius: var(--radius-sm); padding: 14px 18px; color: var(--slate-700);
  font-size: 14.5px; line-height: 1.7;
}
.docs-callout code, .docs-p code, .docs-note code {
  font-family: var(--mono); font-size: .88em; color: var(--violet-700);
  background: rgba(109,40,217,.07); padding: 1px 5px; border-radius: 5px;
}

/* ---------- Method table ---------- */
.docs-table-wrap {
  margin-top: 18px; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: #fff; box-shadow: var(--shadow-sm);
}
.docs-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.docs-table th, .docs-table td {
  text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--slate-100);
  vertical-align: top;
}
.docs-table thead th {
  background: var(--slate-50); color: var(--slate-500); font-size: 12px;
  text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
}
.docs-table tbody tr:last-child td { border-bottom: none; }
.docs-table tbody tr:hover td { background: var(--slate-50); }
.docs-table .m-name { font-family: var(--mono); font-size: 13px; color: var(--violet-700); white-space: nowrap; font-weight: 600; }
.docs-table .m-name a.m-link { color: inherit; text-decoration: none; }
.docs-table .m-name a.m-link:hover { text-decoration: underline; text-decoration-color: var(--violet-400); text-underline-offset: 2px; }
.docs-table .m-desc { color: var(--slate-600); }

/* ---------- Sample blocks ---------- */
.sample-list { display: flex; flex-direction: column; gap: 18px; margin-top: 18px; }
.doc-sample {
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: #fff; box-shadow: var(--shadow-sm); transition: box-shadow .15s, border-color .15s;
}
.doc-sample[open] { border-color: var(--violet-200); box-shadow: var(--shadow); }
.doc-sample summary {
  cursor: pointer; list-style: none; padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.doc-sample summary::-webkit-details-marker { display: none; }
.sample-head { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sample-cap { font-weight: 700; font-size: 15px; color: var(--slate-800); }
.sample-tip { font-size: 13px; color: var(--slate-500); }
.sample-badge {
  flex: none; font-family: var(--mono); font-size: 11.5px; color: var(--violet-700);
  background: var(--violet-50); border: 1px solid var(--violet-100);
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.doc-sample > summary::after {
  content: "+"; flex: none; width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 8px; background: var(--slate-100); color: var(--violet-700);
  font-size: 18px; font-weight: 600; transition: transform .18s;
}
.doc-sample[open] > summary::after { transform: rotate(45deg); }
.doc-sample pre {
  margin: 0; border-top: 1px solid var(--slate-100);
  background: var(--slate-900); color: #E6EDF6;
  padding: 18px 20px; overflow-x: auto;
  font-family: var(--mono); font-size: 12.8px; line-height: 1.65;
  max-height: 520px;
}
.doc-sample pre code { background: none; padding: 0; color: inherit; font-size: inherit; }

/* ---------- Key notes ---------- */
.docs-notes { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.docs-note {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 16px; font-size: 14.5px; color: var(--slate-600); line-height: 1.65;
}
.docs-note .n-ico {
  flex: none; margin-top: 2px; width: 20px; height: 20px; border-radius: 6px;
  background: var(--violet-100); color: var(--violet-700);
  display: grid; place-items: center; font-size: 12px; font-weight: 800;
}
.docs-note b { color: var(--slate-800); }
.docs-note code { font-family: var(--mono); font-size: .86em; color: var(--violet-700); background: rgba(109,40,217,.07); padding: 1px 5px; border-radius: 5px; }

/* ---------- Prev / next ---------- */
.docs-footnav {
  margin: 46px 0 4px; padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.docs-footnav a {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14.5px;
  color: var(--violet-700); transition: color .15s;
}
.docs-footnav a:hover { color: var(--violet-500); }
.docs-footnav .muted { color: var(--slate-400); font-weight: 500; }

/* ---------- Hub ---------- */
.hub-intro-grid { margin-top: 26px; display: grid; grid-template-columns: 1.25fr .9fr; gap: 18px; }
@media (max-width: 900px) { .hub-intro-grid { grid-template-columns: 1fr; } }
.hub-card {
  display: flex; gap: 18px; align-items: flex-start; padding: 18px 20px;
  border: 1px solid var(--border); border-radius: var(--radius); background: #fff;
  box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.hub-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--violet-200); }
.hub-ico {
  flex: none; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 17px;
}
.hub-card h3 { font-size: 16.5px; font-weight: 700; color: var(--slate-900); }
.hub-card h3 small { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--slate-400); font-weight: 500; margin-top: 2px; }
.hub-card p { margin-top: 6px; font-size: 13.5px; color: var(--slate-500); line-height: 1.6; }
.hub-card .go { margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--violet-700); display: inline-flex; gap: 5px; align-items: center; }
.hub-card:hover .go { text-decoration: underline; }
.hub-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 820px) { .hub-grid { grid-template-columns: 1fr; } }
.hub-steps { counter-reset: step; margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.hub-step {
  display: flex; gap: 16px; align-items: flex-start;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 18px;
}
.hub-step .st-no {
  counter-increment: step; flex: none; width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, var(--violet-600), var(--violet-700)); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 800;
}
.hub-step .st-no::before { content: counter(step); }
.hub-step p { font-size: 14.5px; color: var(--slate-600); }
.hub-step p code { font-family: var(--mono); font-size: .86em; color: var(--violet-700); background: rgba(109,40,217,.07); padding: 1px 5px; border-radius: 5px; }

/* ---------- Hub extras (i18n-safe markup) ---------- */
a.hub-card { text-decoration: none; color: inherit; }
.hub-card .hub-body { flex: 1; min-width: 0; }
.hub-card h3 { margin: 0; }
.hub-card .hub-cs {
  display: inline-block; margin: 8px 0 0; font-family: var(--mono); font-size: 11.5px;
  color: var(--violet-700); background: var(--violet-50);
  border: 1px solid var(--violet-100); padding: 3px 10px; border-radius: 999px;
}
.hub-card p { margin-top: 8px; }
.hub-step .st-body { flex: 1; min-width: 0; }
.hub-step .st-body h4 { margin: 1px 0 5px; font-size: 15.5px; font-weight: 700; color: var(--slate-900); }
.hub-step .st-body p { margin: 0; }
.docs-section .docs-callout { margin-top: 0; }

/* ---------- Full-source download block (Modules.zip) ---------- */
.docs-download {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 18px; padding: 20px 22px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.docs-download .dl-ico {
  flex: none; width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--violet-600), var(--violet-700)); color: #fff;
}
.docs-download .dl-body { flex: 1 1 320px; min-width: 0; }
.docs-download .dl-body h4 { margin: 0; font-size: 15.5px; font-weight: 700; color: var(--slate-900); }
.docs-download .dl-body p { margin: 5px 0 0; font-size: 14px; line-height: 1.55; color: var(--slate-600); }
.docs-download .dl-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 9px; font-size: 12.5px; color: var(--slate-500);
}
.docs-download .dl-meta code {
  font-family: var(--mono); font-size: 12px; color: var(--violet-700);
  background: var(--violet-50); border: 1px solid var(--violet-100);
  padding: 2px 8px; border-radius: 999px;
}
.docs-download .dl-actions { flex: none; }
/* 置于页面顶部（hero 正下方）时不要额外上间距 */
.docs-container > .docs-download:first-child { margin-top: 0; }
.docs-download + .docs-callout { margin-top: 18px; }
@media (max-width: 640px) {
  .docs-download .dl-actions { width: 100%; }
  .docs-download .dl-actions .btn { width: 100%; }
}
