/* ========== SD 专区文档：沿用 sdhome 变量，追加文档外观 ========== */
:root{
  --doc-max: 1000px;
  --frost-bg: rgba(255,255,255,.66);
  --frost-line: rgba(255,255,255,.35);
  --frost-shadow: 0 18px 50px rgba(0,0,0,.35);
  --card-radius: 16px;
}


/* 去掉普通文档的左侧边栏布局影响 */
.container { margin-left: 0 !important; }


/* HERO（与 sdhome 同风格，但标题卡毛玻璃） */
.hero-doc { position: relative; min-height: clamp(560px, 70vh, 720px); display: flex; align-items: center; }
.hero-doc .hero-overlay{
  position:absolute; inset:0;
  background:
    radial-gradient(1100px 420px at 42% 62%, rgba(255,255,255,.18), rgba(255,255,255,.06)),
    linear-gradient(180deg, rgba(249,168,212,.08), rgba(147,197,253,.06));
}
.title-card{
  max-width: 840px; margin: 0 auto;
  background: var(--frost-bg);
  border: 1px solid var(--frost-line);
  border-radius: 18px;
  backdrop-filter: blur(10px) saturate(140%);
  padding: 28px 24px;
  box-shadow: var(--frost-shadow);
}
.title-card h1{ margin: 0 0 6px; font-weight: 800; font-size: clamp(28px, 4.8vw, 44px); color:#0b0b0c; }
.title-card p { margin: 0 0 10px; color:#0b0b0c; }
.title-card .chips{ margin: 6px 0 14px; }
.title-card .btn.primary{ background: linear-gradient(180deg,#fce7f3,#dbeafe); color:#111; border:1px solid rgba(0,0,0,.06); }


/* 主文档容器 */
.doc { max-width: var(--doc-max); margin: 28px auto; }
.doc-wrap{ display:grid; grid-template-columns: 1fr 260px; gap:20px; }
@media (max-width:1024px){ .doc-wrap{ grid-template-columns: 1fr; } }


/* 正文毛玻璃卡片 */
.frost{
  background: var(--frost-bg);
  border: 1px solid var(--frost-line);
  border-radius: var(--card-radius);
  backdrop-filter: blur(10px) saturate(140%);
  box-shadow: var(--frost-shadow);
}
.frost-lite{
  background: rgba(255,255,255,.5);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: var(--card-radius);
  backdrop-filter: blur(8px) saturate(140%);
  box-shadow: 0 12px 40px rgba(0,0,0,.28);
}


/* 正文基础排版 */
.body{ padding: 28px; color:#0b0b0c; }
.body h2{ font-size: 24px; margin: 20px 0 10px; font-weight: 800; }
.body h3{ font-size: 18px; margin: 16px 0 8px; font-weight: 700; }
.body p, .body li{ line-height: 1.75; color:#111; }
.body a{ color:#0b57d0; text-decoration:none; }
.body a:hover{ text-decoration:underline; }


.step{ padding-left: 0; }
.step>li{
  margin:10px 0; padding: 10px 12px;
  border-left: 3px solid #22c55e; background: rgba(34,197,94,.06);
  border-radius: 6px;
}


/* 图文 */
.figure{ margin: 14px 0; }
.figure img{ display:block; width:100%; height:auto; border-radius: 12px; border:1px solid rgba(0,0,0,.08); cursor: zoom-in; }
.figcap{ font-size: 12px; color:#374151; margin-top: 6px; text-align: center; }


/* 右侧 TOC（悬浮） */
.toc{
  position: sticky; top: 90px; height: fit-content;
  padding: 16px;
}
.toc h4{ font-size: 13px; color:#0b0b0c; margin: 0 0 6px; }
.toc ul{ list-style:none; padding-left: 0; margin: 0; }
.toc li{ margin: 6px 0; }
.toc a{ color:#0b0b0c; font-size: 14px; text-decoration: none; }
.toc a.active{ font-weight: 700; }
@media (max-width:1024px){ .toc{ position: static; } }


/* 网格 */
.grid-2{ display:grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width:720px){ .grid-2{ grid-template-columns: 1fr; } }


/* 代码块（与你通用的交互一致，但视觉跟 SD 同步） */
.body pre{
  position:relative;
  background:#0b1020; color:#e6edf3; border-radius:10px;
  padding:14px 72px 14px 14px;
  max-width:100%;
  overflow:visible; cursor:copy;
  border:1px solid rgba(255,255,255,.08);
}
.body pre .code-scroll{
  overflow:auto; -webkit-overflow-scrolling:touch; max-height:60vh;
  white-space:pre; word-break:normal; overflow-wrap:normal;
  scrollbar-gutter:stable both-edges; padding-right:16px; padding-bottom:10px;
}
.body pre::after{
  content:""; position:absolute; inset:0 0 0 auto; width:56px; pointer-events:none;
  background:linear-gradient(to left, rgba(11,16,32,1), rgba(11,16,32,0));
  border-radius:0 10px 10px 0;
}
.body pre > .copy-btn{
  position:absolute; top:8px; right:8px; z-index:2;
  border:1px solid #313a52; background:#151b2e; color:#cbd5e1;
  padding:4px 8px; border-radius:6px; font-size:12px; cursor:pointer;
}
pre.copied::after{
  content:"Copied"; position:absolute; top:8px; right:8px;
  background:rgba(20,24,38,.95); color:#e6edf3; font-size:12px;
  padding:4px 8px; border-radius:6px; border:1px solid #2b3550;
}


/* 小组件与尾部 */
.code-title{ font-size:12px; color:#374151; margin: 0 0 6px; }
.back{ margin-top: 20px; text-align: center; }
.back a{ color:#0b0b0c; font-weight: 700; text-decoration: none; }
.back a:hover{ text-decoration: underline; }


.easter-egg{
  margin:18px 0 8px; display:flex; justify-content:center; align-items:center; gap:8px;
  color:#6b7280; font-size:13px; user-select:text; opacity:.92;
}
.easter-egg::before, .easter-egg::after{
  content:""; height:1px; flex:1 1 40px;
  background:linear-gradient(to right, transparent, rgba(0,0,0,.18) 35%, rgba(0,0,0,.18) 65%, transparent);
}
.easter-egg span{
  padding:4px 8px; border:1px solid rgba(0,0,0,.12); border-radius:999px; background:rgba(255,255,255,.6); line-height:1;
}


/* 顶栏品牌区（覆盖通用黑字问题，强制使用主题色） */
.topbar .brand{ color: var(--ink); }
.topbar .brand-icon{ height:auto !important; width:70px !important; }
.topbar .brand-sub{
  display:inline-flex; align-items:center; margin-left:6px; padding:3px 10px; height:28px;
  border-radius:999px; background:linear-gradient(90deg,#fde2f3,#dbeafe);
  font-size:12px; font-weight:800; letter-spacing:.2px; color:#111; text-decoration:none;
}
.topbar .brand-sub:hover{ filter:brightness(1.05); }
.topbar .brand a:focus-visible{ outline:2px solid var(--pink); outline-offset:2px; }


/* Reveal 动画（与 sdhome 一致） */
@keyframes fadeUp{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:translateY(0)}}
.reveal{opacity:0;transform:translateY(18px)}
.reveal.in{animation:fadeUp .8s cubic-bezier(.2,.7,.2,1) forwards}


/* --- 主文档区 +30% 宽 --- */
:root{
  --doc-max: 1300px;  /* 原 1000px → 1300px */
}


/* --- HERO 调整：左下对齐、更宽，底部渐变衔接到蓝色背景 --- */
.hero-doc{
  position: relative;
  min-height: clamp(560px, 72vh, 780px);
  display: block; /* 让我们自己控制内层对齐 */
}


/* 底部渐变：从透明 → 深蓝，衔接 body 的夜蓝底 */
.hero-doc::after{
  content:"";
  position:absolute; left:0; right:0; bottom:-1px; height:140px;
  pointer-events:none;
  background: linear-gradient(
    to bottom,
    rgba(11,18,38,0) 0%,
    rgba(11,18,38,.35) 35%,
    var(--bg2) 70%,
    var(--bg) 100%
  );
}


/* 内层容器：把内容推到左下角，稍微离底边一点 */
.hero-doc .hero-inner{
  position: relative;
  display: flex;
  align-items: flex-end;        /* 靠下 */
  justify-content: flex-start;  /* 靠左 */
  min-height: inherit;
  padding: 0 0 8vh;             /* “稍微靠下边一点” */
  text-align: left;             /* 文案左对齐 */
}


/* 毛玻璃标题卡：更宽一些 */
.title-card{
  /* 原 max-width: 840px; 改为更宽的自适应范围 */
  max-width: clamp(760px, 56vw, 1100px);
  margin: 0;               /* 贴左下 */
}


/* 去掉胶囊（防守式，防止旧标记残留） */
.title-card .chips{ display:none !important; }

/* 主文档区 +30% 宽（保持） */
:root{ --doc-max: 1300px; }


/* —— HERO 居中：水平居中；垂直接近中线、略微下移 —— */
.hero-doc{
  position: relative;
  min-height: clamp(560px, 72vh, 780px);
  display: block;
}


/* 底部蓝色衔接渐变（保留） */
.hero-doc::after{
  content:"";
  position:absolute; left:0; right:0; bottom:-1px; height:140px; pointer-events:none;
  background: linear-gradient(
    to bottom,
    rgba(11,18,38,0) 0%,
    rgba(11,18,38,.35) 35%,
    var(--bg2) 70%,
    var(--bg) 100%
  );
}


/* 关键：Hero 内层真正“居中” */
.hero-doc .hero-inner{
  position: relative;
  min-height: inherit;
  display: flex;
  align-items: center;          /* 垂直居中 */
  justify-content: center;      /* 水平居中 */
  padding: 6vh 0 8vh;           /* 略微靠下：中心线下移一点点 */
  text-align: left;             /* 文案仍左对齐（要居中文案可改成 center） */
}


/* 标题毛玻璃：更宽一点、轻微上调避免“太下了”的观感 */
.title-card{
  max-width: clamp(860px, 62vw, 1180px);  /* 宽一点 */
  margin: 0;                               /* 居中由 flex 控制 */
  transform: translateY(-2vh);             /* 从之前的“太下”往上提一丢丢 */
}


/* 保险：如果 HTML 还留着按钮/胶囊，强制隐藏 */
.title-card .chips,
.title-card .btn { display: none !important; }


/* —— 中央文档毛玻璃：整体“亮 20%” —— */
/* 主文档（正文） */
.doc-sd .body.frost{
  background: rgba(255,255,255,.80);    /* 原 .66 → .80，更亮 */
  border-color: rgba(255,255,255,.50);  /* 线也亮一点 */
  box-shadow: 0 18px 50px rgba(0,0,0,.32); /* 阴影稍收一点，避免变灰 */
}


/* 右侧 TOC 也同步增亮 ~20% */
.toc.frost-lite{
  background: rgba(255,255,255,.60);    /* 原 .50 → .60 */
  border-color: rgba(255,255,255,.42);
}


/* 图像/文字对比微调（亮背景上更舒服） */
.body h2, .body h3 { color:#0b0b0c; }
.body p, .body li { color:#111; }

/* Hero 小标题居中 */
.hero.hero-doc .title-card > p{
  text-align: center;
  margin: 8px auto 0;
  max-width: 72ch;            /* 防止超宽一行；可按需调 */
}

