/* ============================================================
   VPNLS · deepdoc.css
   协议参考页(handbook.html)专属样式。
   仅补文档页的排版与章节标记,所有颜色/圆角/阴影均引用
   base.css 的 :root 令牌,不复用也不覆盖共享组件。
   ============================================================ */

/* ------------------------------------------------------------
   页首
   ------------------------------------------------------------ */
.doc-hero {
  position: relative;
  max-width: 100%;
  overflow-x: clip;
  padding-top: 40px;
  padding-bottom: 8px;
}

.doc-hero::before {
  content: "";
  position: absolute;
  inset: -80px 0 auto 0;
  height: 340px;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 18% 0%, var(--accent-08) 0%, transparent 60%),
    radial-gradient(ellipse at 82% 0%, var(--amber-10) 0%, transparent 56%);
}

.doc-hero .wrap {
  position: relative;
  z-index: 1;
}

.doc-hero h1 {
  margin-top: 14px;
}

.doc-hero .lede {
  margin-top: 16px;
  max-width: 68ch;
  font-size: 15.5px;
  line-height: 1.8;
}

.doc-hero .lede a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-24);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.doc-hero .lede a:hover {
  text-decoration-color: var(--accent);
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.doc-meta span {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 26px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-panel);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: var(--shadow-card);
}

/* ------------------------------------------------------------
   正文容器与章节
   ------------------------------------------------------------ */
.doc-article {
  max-width: 960px;
  margin-inline: auto;
  padding-top: 26px;
  padding-bottom: 48px;
}

.doc-sec {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.85;
}

.doc-sec + .doc-sec {
  margin-top: 42px;
  padding-top: 34px;
  border-top: 1px dashed var(--border);
}

.doc-sec > h2 {
  position: relative;
  margin-bottom: 16px;
  padding-left: 54px;
  min-height: 40px;
  color: var(--text);
}

.doc-sec > h2::before {
  content: attr(data-chapter);
  position: absolute;
  left: 0;
  top: 1px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  background: var(--accent-08);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  box-shadow: inset 0 0 0 1px var(--accent-18);
}

.doc-sec h3 {
  margin: 26px 0 10px;
  color: var(--text);
}

.doc-sec p {
  margin: 0 0 14px;
}

.doc-sec ul,
.doc-sec ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.doc-sec li {
  margin-bottom: 7px;
}

.doc-sec li::marker {
  color: var(--accent);
}

.doc-sec strong {
  color: var(--text);
  font-weight: 600;
}

.doc-sec a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-24);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.doc-sec a:hover {
  text-decoration-color: var(--accent);
}

.doc-sec .callout {
  margin: 20px 0;
}

.doc-sec .callout p {
  margin: 0;
  color: inherit;
}

.doc-sec .table-scroll {
  margin: 20px 0;
}

.doc-sec pre {
  margin: 16px 0 18px;
}

/* ------------------------------------------------------------
   协议卡(第 1 章可选增强;当前正文以段落为主,保留给后续扩写)
   ------------------------------------------------------------ */
.proto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 18px 0 20px;
}

.proto-card {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-panel);
  box-shadow: var(--shadow-card);
}

.proto-card .proto-card-name {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  overflow-wrap: anywhere;
}

.proto-card .proto-card-desc {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.6;
}

/* ------------------------------------------------------------
   文末推广块间距
   ------------------------------------------------------------ */
.doc-article .promo-block {
  margin-top: 46px;
}

/* ------------------------------------------------------------
   响应式
   ------------------------------------------------------------ */
@media (max-width: 768px) {
  .doc-hero {
    padding-top: 28px;
  }

  .doc-hero .lede {
    font-size: 14.5px;
    line-height: 1.75;
  }

  .doc-article {
    padding-top: 20px;
    padding-bottom: 36px;
  }
}

@media (max-width: 640px) {
  .doc-sec {
    font-size: 14.5px;
    line-height: 1.8;
  }

  .doc-sec + .doc-sec {
    margin-top: 30px;
    padding-top: 26px;
  }

  .doc-sec > h2 {
    padding-left: 0;
    padding-top: 42px;
    min-height: 0;
  }

  .doc-sec > h2::before {
    top: 0;
    width: 30px;
    height: 30px;
    border-radius: var(--r-sm);
    font-size: 12px;
  }

  .doc-sec h3 {
    margin-top: 22px;
  }

  .doc-meta span {
    font-size: 10.5px;
    min-height: 24px;
    padding: 0 9px;
  }

  .doc-article .promo-block {
    margin-top: 34px;
  }
}