/* =========================================================
   开发文档页 · 全新视觉设计（专属样式，不污染其它页面）
   设计语言：深色科技感 Hero + 清爽内容区，青绿品牌色
   ========================================================= */

/* ---------- 顶部 Hero（全新设计） ---------- */
.docs-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0A1626 0%, #0F2E26 46%, #0D9488 135%);
  padding: 64px 0 76px;
  color: #fff;
}
/* 背景网格纹理 */
.docs-hero-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: radial-gradient(ellipse 90% 90% at 50% 30%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 90% 90% at 50% 30%, #000 30%, transparent 100%);
}

/* 光晕装饰 */
.docs-hero-glow {
  position: absolute; border-radius: 50%; filter: blur(60px);
  pointer-events: none;
}
.docs-hero-glow-1 {
  width: 460px; height: 460px; top: -180px; right: 6%;
  background: radial-gradient(circle, rgba(20,184,166,0.32) 0%, rgba(20,184,166,0) 70%);
}
.docs-hero-glow-2 {
  width: 380px; height: 380px; bottom: -160px; left: -80px;
  background: radial-gradient(circle, rgba(56,189,248,0.22) 0%, rgba(56,189,248,0) 70%);
}

.docs-hero-inner {
  position: relative; z-index: 2;
  width: 100%; max-width: none;
  padding: 0 40px;
  display: flex; align-items: center; justify-content: space-between; gap: 48px;
  box-sizing: border-box;
}

/* 左侧文案 */
.docs-hero-left { max-width: 640px; }

.docs-hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.22);
  color: #e6fffa;
  padding: 7px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 500; margin-bottom: 20px;
  backdrop-filter: blur(6px);
}
.docs-hero-badge-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #5eead4; box-shadow: 0 0 0 3px rgba(94,234,212,0.25);
}

.docs-hero-title {
  font-size: 44px; font-weight: 800; line-height: 1.15;
  margin: 0 0 14px; letter-spacing: 1px; color: #fff;
}
.docs-hero-plain {
  color: #e6fffa;
  text-shadow: 0 0 24px rgba(94,234,212,0.35);
}
.docs-hero-highlight {
  background: linear-gradient(120deg, #5eead4 0%, #2dd4bf 45%, #34d399 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.docs-hero-desc {
  font-size: 16px; line-height: 1.8; color: rgba(226,232,240,0.85);
  margin: 0 0 26px; max-width: 540px;
}

.docs-hero-meta {
  display: flex; flex-wrap: wrap; gap: 12px;
}
.docs-hero-meta-item {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: #cbd5e1; font-size: 13px;
  padding: 6px 14px; border-radius: 999px;
}
.docs-hero-meta-item b { color: #5eead4; font-size: 15px; }

/* 右侧装饰：代码窗口 + 浮动标签 */
.docs-hero-right {
  position: relative; flex-shrink: 0;
  width: 340px; margin: 8px 12px 8px 0;
}

.docs-code-card {
  background: rgba(15,23,42,0.72);
  border: 1px solid rgba(148,163,184,0.25);
  border-radius: 14px;
  box-shadow: 0 24px 48px -18px rgba(2,6,23,0.55);
  backdrop-filter: blur(10px);
  overflow: hidden;
  transform: rotate(-1deg);
}
.docs-code-head {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px;
  background: rgba(148,163,184,0.10);
  border-bottom: 1px solid rgba(148,163,184,0.16);
}
.docs-code-head i {
  width: 10px; height: 10px; border-radius: 50%;
  background: #f87171; display: inline-block;
}
.docs-code-head i:nth-child(2) { background: #fbbf24; }
.docs-code-head i:nth-child(3) { background: #34d399; }
.docs-code-head span {
  margin-left: 8px; font-size: 12px; color: #94a3b8; font-family: Consolas, monospace;
}
.docs-code-body {
  padding: 16px 18px; font-size: 13px; line-height: 2.1;
  font-family: Consolas, "Courier New", monospace;
}
.docs-code-body p { margin: 0; white-space: nowrap; }
.tok-k { color: #5eead4; }
.tok-s { color: #7dd3fc; }
.tok-c { color: #64748b; }

.docs-hero-chip {
  position: absolute; z-index: 3;
  background: rgba(255,255,255,0.92);
  color: #0f172a; font-size: 13px; font-weight: 600;
  padding: 8px 16px; border-radius: 999px;
  box-shadow: 0 14px 30px -10px rgba(2,6,23,0.5);
  white-space: nowrap;
}
.docs-hero-chip-1 { top: -16px; left: -34px; }
.docs-hero-chip-2 { top: 46%; right: -30px; }
.docs-hero-chip-3 { bottom: -14px; left: 24px; }

/* 底部波浪过渡 */
.docs-hero-wave {
  position: absolute; left: 0; right: 0; bottom: -1px; z-index: 1;
  line-height: 0;
}
.docs-hero-wave svg { width: 100%; height: 64px; display: block; }

/* ---------- 容器（全屏，无左右空白） ---------- */
/* 覆盖公共 .container.main-content 的 1200px 限制（仅文档页生效） */
body .container.main-content {
  max-width: none; width: 100%; box-sizing: border-box;
  padding: 24px 24px 48px;
}
.docs-wrap { width: 100%; max-width: none; margin: 0 auto; padding: 0; box-sizing: border-box; }

/* ---------- 分类 Tab（重新设计） ---------- */
.docs-tabs {
  position: sticky; top: 0; z-index: 50;
  display: flex; gap: 12px; flex-wrap: wrap;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(10px);
  padding: 14px 18px; margin: -34px 0 26px; border-radius: 16px;
  box-shadow: 0 10px 30px -12px rgba(13,148,136,0.16);
  border: 1px solid #e2e8f0;
}
.docs-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; cursor: pointer; font-size: 14px; font-weight: 500;
  color: #475569; background: #f1f5f9; border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.22s; white-space: nowrap; user-select: none;
}
.docs-tab:hover { color: #0d9488; background: #e0f2f1; border-color: #99f6e4; transform: translateY(-1px); }
.docs-tab.active {
  color: #fff;
  background: linear-gradient(135deg, #0b1b2b 0%, #115e4f 60%, #0d9488 130%);
  border-color: transparent;
  box-shadow: 0 8px 22px -8px rgba(13,148,136,0.55);
  font-weight: 600;
}
.docs-tab-icon { font-size: 16px; }
.docs-tab-count {
  background: rgba(100,116,139,0.14); color: #475569;
  font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 600;
}
.docs-tab.active .docs-tab-count { background: rgba(255,255,255,0.2); color: #fff; }

/* ---------- 布局 ---------- */
.docs-layout { display: flex; gap: 22px; align-items: flex-start; }

/* ---------- 侧边栏目录（重新设计） ---------- */
.docs-sidebar {
  width: 258px; flex-shrink: 0; position: sticky; top: 86px;
  background: #fff; border-radius: 16px; padding: 16px 12px;
  border: 1px solid #e2e8f0; box-shadow: 0 8px 24px -12px rgba(15,23,42,0.10);
  max-height: calc(100vh - 106px); overflow-y: auto;
}
.docs-sidebar-title {
  font-size: 13px; font-weight: 700; color: #0f172a;
  margin: 0 10px 12px; padding-bottom: 12px; border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center; gap: 6px;
}
.docs-sidebar a {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; color: #475569; text-decoration: none; font-size: 13px;
  border-radius: 10px; transition: all 0.16s; line-height: 1.45;
  border-left: 3px solid transparent;
}
.docs-sidebar a .doc-sn { font-size: 11px; color: #94a3b8; min-width: 24px; text-align: right; flex-shrink: 0; }
.docs-sidebar a:hover { background: #f0fdfa; color: #0d9488; }
.docs-sidebar a.active {
  background: linear-gradient(90deg, #e0f2f1 0%, #f0fdfa 100%);
  color: #0d9488; font-weight: 600;
  border-left-color: #0d9488;
}
.docs-sidebar a.active .doc-sn { color: #0d9488; }

/* ---------- 正文区 ---------- */
.docs-main { flex: 1; min-width: 0; }
.docs-pane { display: none; }
.docs-pane.active { display: block; animation: docsFade 0.28s ease; }
@keyframes docsFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.doc-page-card {
  background: #fff; border-radius: 16px; margin-bottom: 22px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 6px 20px -10px rgba(15,23,42,0.08);
  overflow: hidden; transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.doc-page-card:hover { box-shadow: 0 16px 36px -14px rgba(13,148,136,0.20); }

.doc-page-header {
  background: linear-gradient(135deg, #0b1b2b 0%, #0f5a4d 55%, #0d9488 140%);
  color: #fff; padding: 18px 30px; font-size: 18px; font-weight: 700;
  display: flex; align-items: center; gap: 12px;
}
.doc-page-header .doc-sn-badge {
  background: linear-gradient(120deg, #5eead4, #34d399);
  color: #062e25; border-radius: 8px;
  font-size: 13px; padding: 3px 10px; font-weight: 700;
}

.doc-page-body { padding: 28px 34px; line-height: 1.85; color: #334155; font-size: 14.5px; }
.doc-page-body img { max-width: 100%; border-radius: 8px; margin: 12px 0; }

/* 代码块：深色 + 窗口条 */
.doc-page-body pre {
  position: relative;
  background: #0f172a; color: #e2e8f0; padding: 20px 20px 16px; border-radius: 12px;
  overflow-x: auto; font-size: 13px; line-height: 1.7;
  margin: 16px 0; box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.doc-page-body pre::before {
  content: "";
  display: block; height: 10px; margin: -12px 0 14px -4px;
  background:
    radial-gradient(circle 5px at 8px 5px, #f87171 95%, transparent),
    radial-gradient(circle 5px at 24px 5px, #fbbf24 95%, transparent),
    radial-gradient(circle 5px at 40px 5px, #34d399 95%, transparent);
  background-size: 16px 10px;
  opacity: 0.85;
}
.doc-page-body code {
  background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 13px; color: #be185d;
}
.doc-page-body pre code { background: none; color: inherit; padding: 0; }

/* 表格 */
.doc-page-body table {
  width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 13.5px;
  display: table; border-radius: 10px; overflow: hidden;
  box-shadow: 0 1px 8px rgba(15,23,42,0.06);
}
.doc-page-body th, .doc-page-body td {
  border: 1px solid #e2e8f0; padding: 10px 14px; text-align: left; vertical-align: top;
}
.doc-page-body th {
  background: linear-gradient(180deg, #f0fdfa 0%, #e6f7f4 100%);
  color: #0f172a; font-weight: 700;
}
.doc-page-body tr:nth-child(even) td { background: #fafdfc; }
.doc-page-body tr:hover td { background: #f0fdfa; }

/* 小节标题 */
.doc-page-body h3 {
  margin: 30px 0 14px; color: #0f172a; font-size: 17px;
  padding: 4px 0 4px 14px; border-left: 4px solid #0d9488;
  border-radius: 0 6px 6px 0; background: linear-gradient(90deg, #f0fdfa 0%, transparent 70%);
}
.doc-page-body ul, .doc-page-body ol { padding-left: 24px; }
.doc-page-body li { margin-bottom: 5px; }
.doc-page-body p { margin: 10px 0; }
.doc-page-body strong { color: #0f172a; }

/* 提示块：带图标 */
.docs-tip, .docs-warning, .docs-note {
  position: relative;
  padding: 13px 16px 13px 46px; border-radius: 12px; margin: 16px 0;
  font-size: 14px; line-height: 1.75;
}
.docs-tip::before, .docs-warning::before, .docs-note::before {
  position: absolute; left: 15px; top: 13px; font-size: 17px;
}
.docs-tip { background: #f0fdfa; border: 1px solid #99f6e4; color: #134e4a; }
.docs-tip::before { content: "💡"; }
.docs-warning { background: #fef2f2; border: 1px solid #fecaca; color: #7f1d1d; }
.docs-warning::before { content: "⚠️"; }
.docs-note { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a5f; }
.docs-note::before { content: "📘"; }
.docs-tip code, .docs-warning code, .docs-note code { background: rgba(255,255,255,0.8); }
.docs-tip ul, .docs-warning ul, .docs-note ul { margin: 6px 0; padding-left: 20px; }

/* 复制按钮 */
.doc-page-body .code-copy-btn {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  background: rgba(148,163,184,0.18); color: #cbd5e1;
  border: 1px solid rgba(148,163,184,0.35); border-radius: 8px;
  font-size: 12px; padding: 4px 12px; cursor: pointer; transition: all 0.2s;
}
.doc-page-body .code-copy-btn:hover { background: rgba(94,234,212,0.2); color: #5eead4; border-color: #5eead4; }
.doc-page-body .code-copy-btn.copied { background: rgba(52,211,153,0.25); color: #34d399; border-color: #34d399; }

/* 空状态 */
.docs-empty {
  text-align: center; padding: 60px 20px; color: #94a3b8;
  background: #fff; border-radius: 16px; border: 1px dashed #cbd5e1;
}
.docs-empty-icon { font-size: 48px; margin-bottom: 16px; }

/* ---------- 移动端 ---------- */
@media (max-width: 992px) {
  .docs-hero { padding: 48px 0 60px; }
  .docs-hero-inner { flex-direction: column; gap: 36px; text-align: center; padding: 0 20px; }
  .docs-hero-left { max-width: 100%; }
  .docs-hero-desc { margin-left: auto; margin-right: auto; }
  .docs-hero-meta { justify-content: center; }
  .docs-hero-right { width: 280px; margin: 0; }
  .docs-hero-title { font-size: 34px; }

  .docs-layout { flex-direction: column; }
  .docs-sidebar {
    width: 100%; position: static; max-height: none;
    display: flex; flex-wrap: wrap; gap: 6px; padding: 14px;
  }
  .docs-sidebar-title { width: 100%; }
  .docs-sidebar a { padding: 7px 12px; }
  .docs-tab { padding: 8px 16px; }
}
