/* PRD 正文排版 */
.prd-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 96px;
  align-items: start;
}

.prd-sidebar {
  position: sticky;
  top: 64px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  padding: 16px 0;
}
.prd-sidebar::-webkit-scrollbar { width: 4px; }
.prd-sidebar::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

.prd-sidebar-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  padding-left: 12px;
}
.prd-toc { list-style: none; }
.prd-toc li { margin: 2px 0; }
.prd-toc a {
  display: block;
  padding: 7px 12px;
  font-size: 12px;
  color: var(--muted);
  border-radius: 8px;
  border-left: 2px solid transparent;
  text-decoration: none;
  line-height: 1.4;
  transition: color .15s, background .15s, border-color .15s;
}
.prd-toc a:hover {
  color: var(--text);
  background: rgba(243,127,19,.08);
  text-decoration: none;
}
.prd-toc a.active {
  color: var(--accent);
  background: rgba(243,127,19,.12);
  border-left-color: var(--accent);
  font-weight: 600;
}

.prd-main { min-width: 0; }

.prd-hero {
  margin-bottom: 28px;
  padding: 28px 28px 24px;
  background: linear-gradient(135deg, #1a1d24 0%, #151820 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}
.prd-hero::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(243,127,19,.15) 0%, transparent 70%);
  pointer-events: none;
}
.prd-hero h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 16px;
  position: relative;
}
.prd-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  position: relative;
}
.prd-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(243,127,19,.15);
  color: var(--accent);
  border: 1px solid rgba(243,127,19,.3);
}
.prd-badge-scope {
  background: rgba(34,197,94,.12);
  color: var(--ok);
  border-color: rgba(34,197,94,.3);
}

.prd-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  position: relative;
}
.prd-meta-item {
  background: rgba(0,0,0,.25);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.prd-meta-item .k {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
}
.prd-meta-item .v {
  font-size: 13px;
  line-height: 1.45;
}

.prd-body > h1:first-child { display: none; }
.prd-body > table:first-of-type { display: none; }

.prd-body blockquote {
  margin: 16px 0 20px;
  padding: 14px 16px 14px 18px;
  background: rgba(243,127,19,.06);
  border: 1px solid rgba(243,127,19,.2);
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  font-size: 13px;
  color: #d4d8de;
  line-height: 1.65;
}
.prd-body blockquote p { margin: 0; }
.prd-body blockquote + blockquote { margin-top: -8px; }

.prd-body hr {
  border: none;
  height: 1px;
  background: var(--line);
  margin: 32px 0;
}

.prd-body h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin: 48px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  scroll-margin-top: 72px;
}
.prd-body h1:first-of-type { margin-top: 0; }

.prd-body h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  margin: 28px 0 12px;
  scroll-margin-top: 72px;
}
.prd-body h3 {
  font-size: 14px;
  font-weight: 700;
  color: #c8cdd4;
  margin: 20px 0 10px;
}

.prd-body p,
.prd-body li {
  font-size: 14px;
  line-height: 1.75;
  color: #c8cdd4;
}
.prd-body p { margin: 0 0 12px; }
.prd-body ul, .prd-body ol {
  margin: 0 0 16px;
  padding-left: 22px;
}
.prd-body li { margin: 6px 0; }
.prd-body strong { color: var(--text); font-weight: 700; }

.prd-body table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  margin: 12px 0 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.prd-body thead { background: #252932; }
.prd-body th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--line);
}
.prd-body td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.55;
}
.prd-body tr:last-child td { border-bottom: none; }
.prd-body tbody tr:hover td { background: rgba(255,255,255,.02); }

.prd-body pre {
  margin: 12px 0 20px;
  padding: 16px 18px;
  background: #0c0e12;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.6;
  color: #a8b4c4;
}
.prd-body pre code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  background: none;
  padding: 0;
}
.prd-body code {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  background: rgba(243,127,19,.12);
  color: #fbbf24;
  padding: 2px 6px;
  border-radius: 4px;
}

.prd-body a { color: var(--accent); font-weight: 600; }

.prd-footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 860px) {
  .prd-layout { grid-template-columns: 1fr; padding: 20px 16px 64px; }
  .prd-sidebar {
    position: static;
    max-height: none;
    padding: 0;
    margin-bottom: 8px;
  }
  .prd-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .prd-toc li { margin: 0; }
  .prd-toc a {
    padding: 6px 10px;
    border-left: none;
    border: 1px solid var(--line);
    font-size: 11px;
  }
  .prd-hero { padding: 20px; }
  .prd-hero h1 { font-size: 22px; }
}
