/* ═══════════════════════════════════════════════
   二键玩 · 内页 (文档 / 教程 / 联系)
   ═══════════════════════════════════════════════ */

/* ── 页头 ──────────────────────────────────── */
.page-hero {
  position: relative;
  padding-top: calc(var(--nav-h) + 60px);
  padding-bottom: 48px;
  border-bottom: 1px solid var(--line);
  overflow: clip;
}

.page-hero .orb--b {
  top: -320px;
  right: -120px;
  width: 560px;
  height: 560px;
  opacity: 0.26;
}

.page-hero .orb--a {
  bottom: -420px;
  left: -160px;
  width: 520px;
  height: 520px;
  opacity: 0.18;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 0.8125rem;
  color: var(--text-3);
}

.crumbs a:hover {
  color: var(--text-2);
}

.crumbs .icon {
  width: 13px;
  height: 13px;
  opacity: 0.6;
}

.page-hero__title {
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.2;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.page-hero__desc {
  max-width: 40em;
  margin-top: 16px;
  font-size: clamp(0.9375rem, 1.2vw, 1.0625rem);
  line-height: 1.85;
  color: var(--text-2);
}

.page-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

/* ── 文档布局 ──────────────────────────────── */
.docs {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr) 196px;
  gap: clamp(28px, 3.4vw, 52px);
  align-items: start;
  padding-block: 52px 100px;
}

.docs__toggle {
  display: none;
}

/* 移动端悬浮目录入口：滚过顶部按钮后常驻，随时呼出抽屉 */
.doc-fab {
  position: fixed;
  right: 24px;
  bottom: 84px;
  z-index: 90;
  display: none;
  align-items: center;
  gap: 7px;
  height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(15, 19, 29, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 34px -16px rgba(0, 0, 0, 0.9);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s, color 0.2s,
    border-color 0.2s;
}

.doc-fab .icon {
  width: 17px;
  height: 17px;
}

.doc-fab.is-show {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.doc-fab.is-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
}

.doc-fab:hover {
  color: var(--text);
  border-color: rgba(124, 108, 255, 0.5);
}

.doc-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  max-height: calc(100dvh - var(--nav-h) - 48px);
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
}

.doc-search {
  position: relative;
  margin-bottom: 24px;
}

.doc-search .icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-3);
  pointer-events: none;
}

.doc-search input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 38px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.875rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.3s, background 0.3s;
}

.doc-search input::placeholder {
  color: var(--text-3);
}

.doc-search input:focus {
  border-color: rgba(124, 108, 255, 0.55);
  background: rgba(124, 108, 255, 0.08);
}

.doc-nav__group + .doc-nav__group {
  margin-top: 26px;
}

.doc-nav__group h4 {
  margin-bottom: 10px;
  padding-left: 12px;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
}

.doc-nav__group a {
  position: relative;
  display: block;
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 0.875rem;
  color: var(--text-2);
  transition: color 0.2s, background 0.2s;
}

.doc-nav__group a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.doc-nav__group a.is-active {
  color: #c3d1ff;
  background: rgba(124, 108, 255, 0.14);
  font-weight: 600;
}

.doc-nav__group a.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 2px;
  height: 14px;
  border-radius: 2px;
  background: var(--grad);
  transform: translateY(-50%);
}

.doc-empty {
  display: none;
  padding: 18px 12px;
  font-size: 0.85rem;
  color: var(--text-3);
  line-height: 1.7;
}

.doc-empty.is-show {
  display: block;
}

/* 目录 */
.doc-toc {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  max-height: calc(100dvh - var(--nav-h) - 48px);
  overflow-y: auto;
  font-size: 0.8125rem;
}

.doc-toc h4 {
  margin-bottom: 14px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-3);
}

.doc-toc a {
  display: block;
  padding: 5px 0 5px 12px;
  border-left: 1px solid var(--line);
  color: var(--text-3);
  line-height: 1.6;
  transition: color 0.2s, border-color 0.2s;
}

.doc-toc a:hover {
  color: var(--text-2);
}

.doc-toc a.is-active {
  color: #a9bcff;
  border-left-color: var(--brand);
}

/* ── 正文 ──────────────────────────────────── */
.doc-article {
  min-width: 0;
  font-size: 0.9375rem;
}

.doc-article > p:first-child {
  font-size: 1rem;
}

.doc-article h2 {
  margin: 60px 0 18px;
  font-size: clamp(1.35rem, 2.2vw, 1.6rem);
  line-height: 1.35;
  letter-spacing: -0.025em;
  font-weight: 700;
  scroll-margin-top: calc(var(--nav-h) + 28px);
}

.doc-article h2:first-of-type {
  margin-top: 8px;
}

.doc-article h3 {
  margin: 34px 0 12px;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  scroll-margin-top: calc(var(--nav-h) + 28px);
}

.doc-article p {
  margin: 14px 0;
  color: var(--text-2);
  line-height: 1.95;
}

.doc-article strong {
  color: var(--text);
  font-weight: 600;
}

.doc-article a:not(.btn) {
  color: #9db4ff;
  border-bottom: 1px solid rgba(157, 180, 255, 0.3);
  transition: border-color 0.2s, color 0.2s;
}

.doc-article a:not(.btn):hover {
  color: #c3d1ff;
  border-bottom-color: rgba(195, 209, 255, 0.7);
}

.doc-article ul,
.doc-article ol {
  display: grid;
  gap: 9px;
  margin: 16px 0;
}

.doc-article ul li {
  position: relative;
  padding-left: 22px;
  color: var(--text-2);
  line-height: 1.85;
}

.doc-article ul li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: rgba(124, 108, 255, 0.75);
}

.doc-article ol {
  counter-reset: li;
}

.doc-article ol li {
  position: relative;
  padding-left: 30px;
  counter-increment: li;
  color: var(--text-2);
  line-height: 1.85;
}

.doc-article ol li::before {
  content: counter(li);
  position: absolute;
  left: 0;
  top: 2px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid rgba(124, 108, 255, 0.35);
  background: rgba(124, 108, 255, 0.12);
  font-family: var(--mono);
  font-size: 0.68rem;
  color: #a9bcff;
}

.doc-article code:not(pre code) {
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.055);
  font-family: var(--mono);
  font-size: 0.855em;
  color: #b9c6ff;
  white-space: normal;
  overflow-wrap: anywhere;
}

.doc-article table {
  margin: 20px 0;
  font-size: 0.875rem;
}

.doc-article th {
  padding: 11px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}

.doc-article td {
  padding: 12px 14px;
  color: var(--text-2);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.doc-article tr:last-child td {
  border-bottom: 0;
}

.doc-article td code {
  white-space: nowrap;
}

/* 两列表格：首列较短，不折行 */
.doc-article .table--kv td:first-child {
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  scrollbar-width: thin;
}

/* 代码块 */
.code-wrap {
  position: relative;
  margin: 18px 0;
}

.code-wrap .code-block__bar {
  border-radius: 12px 12px 0 0;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--font);
  font-size: 0.68rem;
  color: var(--text-3);
  transition: color 0.2s, background 0.2s;
}

.copy-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.copy-btn .icon {
  width: 12px;
  height: 12px;
}

/* 提示框 */
.callout {
  display: flex;
  gap: 13px;
  margin: 20px 0;
  padding: 16px 18px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--text-2);
}

.callout > .icon {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 3px;
}

.callout > div {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.callout b {
  display: block;
  margin-bottom: 3px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text);
}

.callout--info {
  border-color: rgba(77, 124, 254, 0.28);
  background: rgba(77, 124, 254, 0.09);
}

.callout--info > .icon {
  color: #8ba4ff;
}

.callout--tip {
  border-color: rgba(52, 211, 153, 0.26);
  background: rgba(52, 211, 153, 0.075);
}

.callout--tip > .icon {
  color: #52d6a4;
}

.callout--warn {
  border-color: rgba(251, 191, 36, 0.26);
  background: rgba(251, 191, 36, 0.075);
}

.callout--warn > .icon {
  color: #f2c14e;
}

/* 功能函数条目 */
.fn {
  margin: 22px 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.035),
    rgba(255, 255, 255, 0.01)
  );
  scroll-margin-top: calc(var(--nav-h) + 28px);
}

.fn__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.fn__head code {
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  color: #a9bcff;
}

.fn__head .tag {
  margin-left: auto;
}

.fn__doc {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(4, 6, 11, 0.72);
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.95;
  color: rgba(234, 240, 251, 0.55);
  overflow-x: auto;
  white-space: pre;
  scrollbar-width: thin;
}

.fn__doc .k {
  color: #c084fc;
}

.fn ul {
  margin: 0;
}

/* ── 函数手册页 ────────────────────────────── */
.docs--api {
  grid-template-columns: 268px minmax(0, 1fr);
}

/* 函数手册页：精简页头 */
.page-hero--api {
  padding-top: calc(var(--nav-h) + 34px);
  padding-bottom: 26px;
}

.page-hero--api .api-stats {
  margin-top: 0;
}

.api-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.api-stats > div {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.api-stats b {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: #c3d1ff;
}

.api-stats span {
  font-size: 0.78rem;
  color: var(--text-3);
}

/* 侧栏计数 */
.api-nav .doc-nav__group h4,
.api-nav .doc-nav__group a {
  display: flex;
  align-items: center;
}

.api-nav .doc-nav__group h4 {
  padding-right: 12px;
  cursor: pointer;
  user-select: none;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.api-nav .doc-nav__group h4:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.api-nav .doc-nav__group h4:focus-visible {
  outline: 2px solid rgba(124, 108, 255, 0.6);
  outline-offset: 2px;
}

.doc-nav__chev {
  flex: none;
  width: 14px;
  height: 14px;
  margin-left: 6px;
  color: var(--text-3);
  transition: transform 0.22s ease;
}

.doc-nav__group.is-collapsed .doc-nav__chev {
  transform: rotate(-90deg);
}

.doc-nav__group.is-collapsed .api-nav__sub {
  display: none;
}

/* 搜索时强制展开，并暂禁用折叠开关 */
.api-nav.is-searching .doc-nav__group.is-collapsed .api-nav__sub {
  display: block;
}

.api-nav.is-searching .doc-nav__chev {
  visibility: hidden;
}

.api-nav.is-searching .doc-nav__group h4 {
  cursor: default;
  pointer-events: none;
}

.api-nav.is-searching .api-nav__sub.is-collapsed .api-nav__fns {
  display: block;
}

.api-nav.is-searching .api-nav__sub-toggle {
  visibility: hidden;
}

.api-nav.is-searching .api-nav__sub-head {
  cursor: default;
}

/* 二级子类折叠：整行标题可点，箭头仅作指示 */
.api-nav__sub-head {
  display: flex;
  align-items: center;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.2s;
}

.api-nav__sub-head:hover {
  background: rgba(255, 255, 255, 0.05);
}

.api-nav__sub-head a.api-nav__sub-link {
  flex: 1;
  min-width: 0;
  padding-block: 9px;
}

/* 整行统一 hover 高亮，避免链接单侧变色 */
.api-nav__sub-head a.api-nav__sub-link:hover {
  background: none;
}

.api-nav__sub-toggle {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin: 0 6px 0 2px;
  color: var(--text-3);
  transition: color 0.2s;
}

.api-nav__sub-toggle .icon {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
}

.api-nav__sub.is-collapsed .api-nav__sub-toggle .icon {
  transform: rotate(-90deg);
}

.api-nav__sub.is-collapsed .api-nav__fns {
  display: none;
}

.api-nav__count {
  margin-left: auto;
  padding-left: 10px;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--text-3);
}

/* 侧栏三级目录：子类 + 函数名 */
.api-nav .doc-nav__group a.api-nav__sub-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
}

.api-nav__fns {
  margin: 0 0 8px 13px;
  padding-left: 7px;
  border-left: 1px solid var(--line);
}

.api-nav .doc-nav__group a.api-nav__fn {
  display: block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.api-nav .doc-nav__group a.api-nav__fn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.api-nav .doc-nav__group a.api-nav__fn.is-active {
  color: #c3d1ff;
  background: rgba(124, 108, 255, 0.14);
}

.api-nav .doc-nav__group a.api-nav__fn.is-active::before {
  display: none;
}

/* 正文 */
.api-intro {
  margin: 0 0 24px;
}

.api-result {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding: 11px 16px;
  border: 1px solid rgba(124, 108, 255, 0.28);
  border-radius: 11px;
  background: rgba(124, 108, 255, 0.08);
  font-size: 0.85rem;
  color: var(--text-2);
}

.api-result[hidden] {
  display: none;
}

.api-result b {
  font-family: var(--mono);
  color: #c3d1ff;
}

.api-result button {
  margin-left: auto;
  padding: 4px 11px;
  border-radius: 7px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.75rem;
  color: var(--text-2);
  transition: background 0.2s, color 0.2s;
}

.api-result button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.api-empty {
  margin-bottom: 20px;
  padding: 24px 18px;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  text-align: center;
}

.api-article .api-cat > h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 56px 0 18px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}

.api-cat,
.api-sub {
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

.api-article .api-cat:first-of-type > h2 {
  margin-top: 8px;
  padding-top: 0;
  border-top: 0;
}

.api-article .api-sub > h3 {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 30px 0 12px;
  font-size: 0.95rem;
}

.api-cat__count,
.api-sub__count {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--text-3);
}

/* 函数卡片 */
.api-fn {
  margin: 14px 0;
  padding: 20px 22px;
  overflow-wrap: anywhere;
}

.api-fn .fn__head {
  gap: 8px;
  margin-bottom: 10px;
}

.api-fn .fn__head code {
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.api-fn .fn__head .tag {
  margin-left: 0;
}

.api-fn__alias {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-3);
}

.api-article .api-fn__desc {
  margin: 0 0 14px;
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--text-2);
}

.api-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding: 5px 9px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.72rem;
  color: var(--text-3);
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.api-copy .icon {
  width: 13px;
  height: 13px;
}

.api-copy:hover {
  color: var(--text);
  border-color: var(--line-2);
  background: rgba(255, 255, 255, 0.07);
}

.api-copy.is-done {
  color: #7fe3bb;
  border-color: rgba(52, 211, 153, 0.35);
}

/* 参数与返回值 */
.api-table {
  margin: 0 0 14px;
}

.api-table table {
  font-size: 0.82rem;
}

.api-table td code {
  overflow-wrap: normal;
}

.api-article .api-table td code {
  font-size: 0.78rem;
  white-space: nowrap;
}

.api-type {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-2);
  white-space: nowrap;
}

.api-type--str {
  border-color: rgba(52, 211, 153, 0.28);
  background: rgba(52, 211, 153, 0.08);
  color: #7fe3bb;
}

.api-type--int {
  border-color: rgba(124, 108, 255, 0.3);
  background: rgba(124, 108, 255, 0.1);
  color: #9db4ff;
}

.api-type--float {
  border-color: rgba(168, 132, 255, 0.3);
  background: rgba(168, 132, 255, 0.09);
  color: #c3a8ff;
}

.api-type--bool {
  border-color: rgba(242, 196, 109, 0.28);
  background: rgba(242, 196, 109, 0.08);
  color: #f2c46d;
}

.api-type--table {
  border-color: rgba(125, 211, 232, 0.26);
  background: rgba(125, 211, 232, 0.08);
  color: #7dd3e8;
}

.api-type--any {
  color: var(--text-3);
}

.api-opt {
  margin-left: 6px;
  padding: 0 5px;
  border: 1px dashed var(--line-2);
  border-radius: 4px;
  font-size: 0.62rem;
  color: var(--text-3);
  vertical-align: 1px;
}

.api-def {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--text-3);
}

.api-muted {
  color: var(--text-3);
}

.api-article .api-fn__ret {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--text-2);
}

.api-fn__ret-label {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.68rem;
  color: var(--text-3);
}

.api-ret-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.api-ret-name {
  font-weight: 600;
  color: var(--text);
}

.api-fn__ret.is-none {
  color: var(--text-3);
}

/* 示例折叠 */
.api-example {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.015);
  overflow: hidden;
}

.api-example summary {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.api-example summary::-webkit-details-marker {
  display: none;
}

.api-example summary .icon {
  width: 14px;
  height: 14px;
  transition: transform 0.25s;
}

.api-example[open] summary {
  color: var(--text-2);
  border-bottom: 1px solid var(--line);
}

.api-example[open] summary .icon {
  transform: rotate(180deg);
}

.api-example .code-wrap {
  margin: 0;
}

.api-example .code-block {
  border: 0;
  border-radius: 0;
  background: rgba(4, 6, 11, 0.55);
}

.api-example .code-wrap .code-block__bar {
  border-radius: 0;
}

.api-example .code-wrap + .code-wrap {
  border-top: 1px solid var(--line);
}

.api-example .code-scroll {
  max-height: 340px;
  overflow: auto;
  padding: 14px 16px;
}

.api-example .copy-btn {
  background: rgba(255, 255, 255, 0.06);
}

.api-next {
  margin-top: 60px;
}

@media (max-width: 940px) {
  .api-stats {
    margin-top: 20px;
  }

  .api-fn {
    padding: 18px;
  }

  .api-result button {
    margin-left: 0;
  }

  .api-article .api-cat > h2 {
    margin-top: 44px;
    padding-top: 26px;
  }
}

@media (max-width: 600px) {
  .api-table table {
    margin: 0;
  }

  .api-table thead {
    display: none;
  }

  .api-table tbody,
  .api-table tr,
  .api-table td {
    display: block;
  }

  .api-table tr {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }

  .api-table tr:last-child {
    border-bottom: 0;
  }

  .api-table td {
    padding: 0;
    border-bottom: 0;
  }

  .api-table td:first-child {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }

  .api-article .api-table td code {
    font-size: 0.82rem;
  }

  .api-table td:nth-child(2) {
    margin-top: 6px;
  }

  .api-table td:nth-child(3) {
    margin-top: 4px;
    line-height: 1.75;
  }
}

/* 侧栏抽屉遮罩 */
.docs__backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 130;
  background: rgba(3, 5, 9, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
}

@media (max-width: 1240px) {
  .docs {
    grid-template-columns: 236px minmax(0, 1fr);
  }

  .doc-toc {
    display: none;
  }
}

@media (max-width: 940px) {
  .docs {
    grid-template-columns: minmax(0, 1fr);
    padding-block: 28px 80px;
  }

  .docs__toggle {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    height: 46px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid var(--line-2);
    background: rgba(255, 255, 255, 0.035);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-2);
  }

  .docs__toggle .icon {
    width: 18px;
    height: 18px;
  }

  .docs__toggle span {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--text-3);
  }

  .doc-fab {
    display: inline-flex;
  }

  .doc-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 140;
    width: min(320px, 86vw);
    max-height: none;
    padding: 22px 18px 40px;
    background: #0a0d15;
    border-right: 1px solid var(--line-2);
    box-shadow: 30px 0 60px -20px rgba(0, 0, 0, 0.9);
    transform: translateX(-102%);
    transition: transform 0.36s var(--ease-out);
    overflow-y: auto;
  }

  .doc-sidebar.is-open {
    transform: none;
  }

  .docs__backdrop.is-open {
    display: block;
    opacity: 1;
    visibility: visible;
  }

  .doc-sidebar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 0.95rem;
    font-weight: 700;
  }

  .doc-sidebar__close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
  }
}

@media (min-width: 941px) {
  .doc-sidebar__head {
    display: none;
  }
}

/* ── 教程页 ────────────────────────────────── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.filter {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.25s, background 0.25s, border-color 0.25s;
}

.filter:hover {
  color: var(--text);
  border-color: var(--line-2);
}

.filter.is-active {
  color: #fff;
  border-color: transparent;
  background: var(--grad);
  box-shadow: 0 8px 20px -10px rgba(96, 118, 255, 1);
}

.videos {
  padding-block: 52px 100px;
}

.video-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 0;
  margin-bottom: 44px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  background: linear-gradient(140deg, #121728, #090c14);
  overflow: hidden;
  transition: border-color 0.4s, box-shadow 0.4s;
}

.video-hero:hover {
  border-color: rgba(124, 108, 255, 0.45);
  box-shadow: 0 40px 90px -50px rgba(77, 124, 254, 0.8);
}

.video-hero__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(26px, 3.4vw, 44px);
}

.video-hero__body h2 {
  margin: 14px 0 12px;
  font-size: clamp(1.15rem, 1.9vw, 1.5rem);
  line-height: 1.4;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.video-hero__body p {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text-2);
}

.video-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 20px;
  font-size: 0.8125rem;
  color: var(--text-3);
}

.video-hero__meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.video-hero__meta .icon {
  width: 14px;
  height: 14px;
}

/* 缩略图 */
.thumb {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  text-align: left;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #0b0f18;
  cursor: pointer;
  isolation: isolate;
}

.thumb--flat {
  border-radius: 0;
  aspect-ratio: auto;
  min-height: 300px;
  height: 100%;
}

.thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
      rgba(255, 255, 255, 0.07) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 0.55;
  z-index: 1;
}

.thumb__art {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 16px 20px;
  transition: transform 0.7s var(--ease-out);
}

.thumb:hover .thumb__art {
  transform: scale(1.04);
}

.thumb--a .thumb__art {
  background: radial-gradient(
      circle at 25% 20%,
      rgba(77, 124, 254, 0.55),
      transparent 55%
    ),
    linear-gradient(150deg, #16203a, #0a0e18);
}

.thumb--b .thumb__art {
  background: radial-gradient(
      circle at 75% 25%,
      rgba(139, 92, 246, 0.5),
      transparent 55%
    ),
    linear-gradient(150deg, #201736, #0a0e18);
}

.thumb--c .thumb__art {
  background: radial-gradient(
      circle at 30% 70%,
      rgba(34, 211, 238, 0.38),
      transparent 55%
    ),
    linear-gradient(150deg, #102a33, #080d14);
}

.thumb--d .thumb__art {
  background: radial-gradient(
      circle at 60% 30%,
      rgba(52, 211, 153, 0.34),
      transparent 55%
    ),
    linear-gradient(150deg, #0f2a24, #080d14);
}

.thumb--e .thumb__art {
  background: radial-gradient(
      circle at 40% 40%,
      rgba(251, 191, 36, 0.3),
      transparent 55%
    ),
    linear-gradient(150deg, #2b2314, #0b0d14);
}

.thumb--f .thumb__art {
  background: radial-gradient(
      circle at 70% 65%,
      rgba(236, 72, 153, 0.32),
      transparent 55%
    ),
    linear-gradient(150deg, #2a1526, #0a0d14);
}

.thumb__mono {
  font-family: var(--mono);
  font-size: clamp(2.8rem, 5vw, 4.4rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.06em;
  color: rgba(255, 255, 255, 0.16);
  user-select: none;
}

.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(
    ellipse 90% 70% at 50% 115%,
    rgba(0, 0, 0, 0.55),
    transparent 62%
  );
  pointer-events: none;
}

.thumb--flat .thumb__mono {
  font-size: clamp(3.6rem, 8vw, 6.4rem);
  color: rgba(255, 255, 255, 0.2);
}

.thumb__play {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: rgba(4, 6, 11, 0.22);
  transition: background 0.35s;
}

.thumb:hover .thumb__play {
  background: rgba(4, 6, 11, 0.06);
}

.thumb__play i {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.9);
  transition: transform 0.35s var(--ease), background 0.35s;
}

.thumb:hover .thumb__play i {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.22);
}

.thumb__play .icon {
  width: 20px;
  height: 20px;
  margin-left: 3px;
  fill: #fff;
  stroke: none;
}

.thumb__dur {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 4;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(4, 6, 11, 0.82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.86);
}

/* 视频卡 */
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px 22px;
}

.video-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.video-card[hidden] {
  display: none;
}

.video-card__body {
  padding: 16px 2px 0;
}

.video-card__cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 9px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #9db4ff;
}

.video-card__cat::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.video-card h3 {
  font-size: 0.975rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: -0.01em;
  transition: color 0.25s;
}

.video-card:hover h3 {
  color: #c3d1ff;
}

.video-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--text-3);
}

.videos__empty {
  display: none;
  padding: 60px 0;
  text-align: center;
  color: var(--text-3);
}

.videos__empty.is-show {
  display: block;
}

@media (max-width: 980px) {
  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .video-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .thumb--flat {
    min-height: 0;
    height: auto;
    aspect-ratio: 16 / 9;
    order: -1;
  }
}

@media (max-width: 600px) {
  .video-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 播放弹窗 */
.player {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(150deg, #141a2b, #070a10);
  border: 1px solid var(--line);
}

.player__grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
      rgba(255, 255, 255, 0.06) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.6;
}

.player__stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
}

.player__glyph {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  animation: pulse-ring 2.6s ease-out infinite;
}

.player__glyph .icon {
  width: 24px;
  height: 24px;
  margin-left: 3px;
  fill: currentColor;
  stroke: none;
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(124, 108, 255, 0.45);
  }
  70% {
    box-shadow: 0 0 0 22px rgba(124, 108, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(124, 108, 255, 0);
  }
}

.player__stage b {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
}

.player__stage span {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-3);
}

.player__bar {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.player__bar i {
  display: block;
  height: 100%;
  width: 34%;
  border-radius: inherit;
  background: var(--grad);
  animation: play-progress 9s linear infinite;
}

@keyframes play-progress {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

.lesson-list {
  display: grid;
  gap: 2px;
  margin-top: 20px;
}

.lesson-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 0.85rem;
  color: var(--text-2);
  transition: background 0.2s;
}

.lesson-list li:hover {
  background: rgba(255, 255, 255, 0.04);
}

.lesson-list b {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-3);
}

.lesson-list span:last-child {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-3);
}

/* ── 联系页 ────────────────────────────────── */
.contact {
  padding-block: 56px 24px;
}

.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}

.panel {
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: linear-gradient(
    170deg,
    rgba(255, 255, 255, 0.045),
    rgba(255, 255, 255, 0.01)
  );
}

.panel__title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.panel__sub {
  margin-top: 6px;
  font-size: 0.875rem;
  color: var(--text-2);
}

.form {
  display: grid;
  gap: 18px;
  margin-top: 26px;
}

.form[hidden] {
  display: none;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-2);
}

.field label em {
  margin-left: 3px;
  font-style: normal;
  color: #ff8095;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: rgba(4, 6, 11, 0.5);
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

.field textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.7;
}

.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #8ba4ff 50%),
    linear-gradient(135deg, #8ba4ff 50%, transparent 50%);
  background-position: calc(100% - 19px) calc(50% + 1px),
    calc(100% - 14px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.field select option {
  background: #10141f;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-3);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(124, 108, 255, 0.6);
  background: rgba(124, 108, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(124, 108, 255, 0.12);
}

.field.is-error input,
.field.is-error textarea {
  border-color: rgba(255, 128, 149, 0.6);
}

.field__err {
  display: none;
  font-size: 0.75rem;
  color: #ff9db0;
}

.field.is-error .field__err {
  display: block;
}

.form__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}

.form__foot small {
  font-size: 0.75rem;
  color: var(--text-3);
  line-height: 1.6;
}

.form-success {
  display: none;
  padding: 34px 24px;
  text-align: center;
}

.form-success.is-show {
  display: block;
  animation: panel-in 0.45s var(--ease-out);
}

.form-success__icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 1px solid rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.14);
  color: #34d399;
}

.form-success__icon .icon {
  width: 26px;
  height: 26px;
  stroke-width: 2.4;
}

.form-success h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.form-success p {
  margin: 8px auto 20px;
  max-width: 26em;
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--text-2);
}

.channel-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.channel {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 0.3s, background 0.3s, transform 0.3s var(--ease);
}

.channel:hover {
  border-color: rgba(124, 108, 255, 0.4);
  background: rgba(124, 108, 255, 0.09);
  transform: translateX(3px);
}

.channel__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: #a9bcff;
}

.channel__icon .icon {
  width: 19px;
  height: 19px;
}

.channel b {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
}

.channel span {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-3);
  word-break: break-all;
}

.channel > .icon {
  margin-left: auto;
  width: 15px;
  height: 15px;
  color: var(--text-3);
}

.contact-note {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  padding: 16px;
  border-radius: 12px;
  border: 1px dashed rgba(124, 108, 255, 0.3);
  background: rgba(124, 108, 255, 0.06);
  font-size: 0.8125rem;
  line-height: 1.75;
  color: var(--text-2);
}

.contact-note .icon {
  flex: none;
  width: 17px;
  height: 17px;
  margin-top: 2px;
  color: #9db4ff;
}

/* FAQ */
.faq {
  display: grid;
  gap: 10px;
  margin-top: 26px;
}

.faq__item {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
  overflow: hidden;
  transition: border-color 0.3s, background 0.3s;
}

.faq__item[open] {
  border-color: var(--line-2);
  background: rgba(255, 255, 255, 0.04);
}

.faq__item summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  transition: color 0.2s;
}

.faq__item summary::-webkit-details-marker {
  display: none;
}

.faq__item summary:hover {
  color: #c3d1ff;
}

.faq__item summary .icon {
  width: 16px;
  height: 16px;
  margin-left: auto;
  color: var(--text-3);
  transition: transform 0.3s var(--ease);
}

.faq__item[open] summary .icon {
  transform: rotate(180deg);
}

.faq__item p {
  padding: 0 18px 18px;
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--text-2);
}

@media (max-width: 900px) {
  .contact__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .form-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .form__foot .btn {
    width: 100%;
  }
}

/* ── 相关页尾推荐 ──────────────────────────── */
.next-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 60px;
}

.next-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.875rem;
  font-weight: 600;
  transition: border-color 0.3s, background 0.3s, transform 0.3s var(--ease);
}

.next-link:hover {
  border-color: rgba(124, 108, 255, 0.4);
  background: rgba(124, 108, 255, 0.09);
  transform: translateY(-2px);
}

.next-link .icon {
  width: 17px;
  height: 17px;
  color: #a9bcff;
}

.next-link span {
  margin-left: auto;
  color: var(--text-3);
}

@media (max-width: 760px) {
  .next-links {
    grid-template-columns: minmax(0, 1fr);
  }
}
