/* ==========================================================================
   飞创 AI 中转站 · 资源中心
   设计 token 取自 feichuangtech.cn 实际样式：
   容器 max-w 1200 / px 24 · 导航 h-14 · 正文 #03080a · 次级文字 #606060
   ========================================================================== */


@font-face {
  font-family: "Public Sans Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/assets/fonts/public-sans-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Public Sans Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/assets/fonts/public-sans-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #fcfcfe;
  --surface: #ffffff;
  --surface-2: #f4f6fa;
  --hover: #eef1f7;

  --text: #0b0d12;
  --fg: #0f1115;
  --muted: #646a73;
  --body: #1f2329;

  --primary: #1664ff;
  --primary-hover: #0a53e0;
  --primary-soft: #eef3ff;

  --line: rgba(0, 0, 0, 0.06);
  --line-2: rgba(0, 0, 0, 0.1);

  --r-sm: 8px;
  --r: 10px;
  --r-lg: 16px;
  --r-xl: 22px;

  --nav-h: 56px;
  --shadow-sm: 0 1px 2px rgba(3, 8, 10, 0.04);
  --shadow: 0 16px 40px -16px rgba(3, 8, 10, 0.16);

  --maxw: 1200px;
  --pad: 24px;

  --font: "Public Sans Variable", "Public Sans", "PingFang SC",
    "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  /* 永远给滚动条留位：长页/短页切换时导航不会左右抖 */
  scrollbar-gutter: stable; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 28px); }

body {
  margin: 0;
  padding-top: var(--nav-h);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* ---------- 顶部导航：与官网一致 ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(252, 252, 254, 0.95);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}

.nav__inner {
  max-width: var(--maxw);
  height: var(--nav-h);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: flex; align-items: center; flex: none; }
.brand img {
  width: 154px;
  height: 28px;
  object-fit: contain;
  object-position: left center;
  display: block;
}

/* 菜单位置对齐官网：右侧预留官网那组图标的宽度，左侧留白才会一致 */
.nav__links {
  margin-left: auto;
  margin-right: 13px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav__right { display: flex; align-items: center; gap: 2px; flex: none; }

.nav__links a,
.nav__right a {
  padding: 6px 10px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}
@media (min-width: 1024px) {
  .nav__links a,
  .nav__right a { padding: 6px 12px; }
}
.nav__links a:hover,
.nav__right a:hover { color: var(--fg); }
.nav__links a.is-active,
.nav__right a.is-active { color: var(--fg); }

.nav__cta,
.nav__right a.nav__cta {
  margin-left: 12px;
  height: 36px;
  /* 固定为原「登录/注册」的宽度，换文案时导航栏位置不移动 */
  min-width: 96px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.nav__right a.nav__cta:hover { background: var(--primary-hover); color: #fff; }

/* ---------- 文档三栏骨架 ---------- */

.shell {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 168px;
  gap: 0;
  align-items: start;
}

.sidebar {
  overflow-x: hidden;
  position: sticky;
  top: calc(var(--nav-h) + 52px);
  max-height: calc(100vh - var(--nav-h) - 52px);
  overflow-y: auto;
  padding: 26px 0 64px;
  font-size: 14px;
  transition: opacity .12s ease;
  scrollbar-width: none;      /* Firefox：隐藏滚动条，仍可滚动 */
  -ms-overflow-style: none;   /* 旧 Edge */
}
.sidebar::-webkit-scrollbar { display: none; }
.toc { scrollbar-width: none; -ms-overflow-style: none; }
.toc::-webkit-scrollbar { display: none; }

.sidebar__title {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #646a73;
  padding: 0 10px;
  margin: 0 0 6px;
}
.sidebar a {
  display: block;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--muted);
  line-height: 1.45;
  transition: background 0.15s, color 0.15s;
}
.sidebar a:hover { background: var(--hover); color: var(--fg); }
.sidebar a.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.sidebar__sub { margin: 2px 0 8px 12px; border-left: 1px solid var(--line-2); padding-left: 4px; }
.sidebar__sub a { font-size: 13.5px; padding: 6px 10px; }

/* ---------- 正文 ---------- */

.main {
  padding: 30px 26px 96px;
  min-width: 0;
}

.pagebar {
  grid-column: 1 / -1;
  min-width: 0;
  position: sticky;
  top: var(--nav-h);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 52px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: #646a73;
  overflow: hidden;
}
.pagebar > a {
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pagebar > a:hover { color: var(--primary); }
.pagebar .sep { color: #cfcfcf; }
.pagebar .cur {
  color: var(--muted);
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pagebar .panel-toggle--right { margin-left: auto; }

.doc-title {
  font-size: 36px;
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: normal;
  margin: 0 0 6px;
  color: var(--text);
}

.doc-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: #646a73;
  margin-bottom: 32px;
}
.doc-meta .dot { color: #d4d4d4; }

.prose { font-size: 16px; line-height: 1.63; }

.prose .h-l1 {
  color: var(--body);
  font-size: 22px;
  line-height: 1.45;
  font-weight: 700;
  letter-spacing: normal;
  margin: 40px 0 15px;
  scroll-margin-top: calc(var(--nav-h) + 24px);
}
.prose .h-l2 {
  color: var(--body);
  font-size: 22px;
  line-height: 1.45;
  font-weight: 700;
  letter-spacing: normal;
  margin: 40px 0 15px;
  scroll-margin-top: calc(var(--nav-h) + 24px);
}
.prose .h-l3 {
  color: var(--body);
  font-size: 20px;
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: normal;
  margin: 16px 0;
  scroll-margin-top: calc(var(--nav-h) + 24px);
}
.prose .h-l4 {
  color: var(--body);
  font-size: 20px;
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: normal;
  margin: 16px 0;
  scroll-margin-top: calc(var(--nav-h) + 24px);
}
.prose .h-l1:first-child, .prose .h-l2:first-child, .prose .h-l3:first-child { margin-top: 0; }

.prose p { margin: 0 0 16px; color: var(--body); }
.prose strong, .prose b { font-weight: 600; color: inherit; }
.prose hr { border: 0; border-top: 1px solid var(--line-2); margin: 40px 0; }
.prose a { color: var(--primary); }
.prose a:hover { text-decoration: underline; }

.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; color: var(--body); }
.prose li { margin: 6px 0; }
.prose li::marker { color: #646a73; }

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r);
  border: 1px solid var(--line);
  display: block;
  margin: 22px auto;
}

.prose blockquote {
  margin: 24px 0;
  padding: 2px 0 2px 18px;
  border-left: 3px solid var(--line-2);
  color: var(--muted);
}

/* ---------- 飞书高亮块 ---------- */

.callout {
  display: flex;
  gap: 12px;
  margin: 22px 0;
  padding: 16px 18px;
  border-radius: var(--r);
  border: 1px solid var(--callout-border, #dfe6fb);
  background: var(--callout-bg, #f4f7ff);
}
.callout__emoji { font-size: 18px; line-height: 1.6; flex: none; }
.callout__body { min-width: 0; flex: 1; }
.callout__body > *:last-child { margin-bottom: 0; }
.callout p { color: inherit; }
.callout a { color: inherit; text-decoration: underline; }

/* ---------- 飞书分栏 ---------- */

.columns {
  display: grid;
  grid-template-columns: var(--cols, 1fr 1fr);
  gap: 28px;
  margin: 26px 0;
  align-items: start;
}
.columns > div { min-width: 0; }
.columns > div > *:first-child { margin-top: 0; }
.columns > div > *:last-child { margin-bottom: 0; }

/* ---------- 表格 ---------- */

.table-wrap { margin: 26px 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { margin: 0; }

.prose table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 26px 0;
  font-size: 14.5px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  overflow: hidden;
}
.prose thead th {
  background: #f6f7fa;
  font-weight: 600;
  text-align: left;
  color: var(--fg);
}
.prose th, .prose td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--body);
  vertical-align: top;
}
.prose tbody tr:last-child td { border-bottom: 0; }

/* ---------- 代码块 ---------- */

.code {
  margin: 26px 0;
  border-radius: var(--r);
  overflow: hidden;
  background: #14161b;
}
.code__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  font-size: 12px;
  color: #9aa3b2;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-family: var(--mono);
}
.code pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  color: #e6e9ef;
}
.prose code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: #f1f3f7;
  border-radius: 5px;
  padding: 2px 6px;
  color: #1f2430;
}
.code code { background: none; padding: 0; color: inherit; font-size: inherit; }

/* ---------- 右侧目录 ---------- */

.toc {
  position: sticky;
  top: calc(var(--nav-h) + 52px);
  max-height: calc(100vh - var(--nav-h) - 52px);
  overflow-y: auto;
  padding: 26px 0 64px;
  font-size: 13px;
  transition: opacity .12s ease;
}
.toc__title {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #646a73;
  margin-bottom: 10px;
}
.toc a {
  display: block;
  padding: 4px 0 4px 12px;
  color: #646a73;
  border-left: 2px solid var(--line-2);
  line-height: 1.5;
}
.toc a:hover { color: var(--muted); }
.toc a.is-active { color: var(--primary); border-left-color: var(--primary); font-weight: 500; }
.toc a.toc__l2 { padding-left: 22px; font-size: 12.5px; }
.toc a.toc__l3 { padding-left: 32px; font-size: 12.5px; color: #8b9096; }

/* ---------- 落地页 ---------- */

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }

.hero { padding: 64px 0 16px; text-align: center; }
.hero__badge {
  display: inline-block;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: 56px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
  color: var(--text);
  text-wrap: balance;
}
.hero p {
  font-size: 18px;
  line-height: 1.75;
  color: var(--muted);
  margin: 0 auto;
  max-width: 640px;
}

.search {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  height: 50px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  color: #646a73;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search:focus-within { border-color: rgba(22, 100, 255, 0.45); box-shadow: 0 0 0 4px rgba(22, 100, 255, 0.08); }
.search input {
  flex: 1;
  border: 0;
  outline: 0;
  font-size: 15px;
  font-family: inherit;
  background: none;
  color: var(--text);
}
.search kbd {
  font-family: var(--mono);
  font-size: 11px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 2px 6px;
  color: #646a73;
}

.section { padding: 32px 0; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.section__head h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}
.section__head a { font-size: 14px; color: var(--muted); }
.section__head a:hover { color: var(--primary); }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.card {
  padding: 26px;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--card-tint, #f3f4fe) 0%, #fff 64%);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: block;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: rgba(0, 0, 0, 0.09); }
.card__icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(0, 0, 0, 0.05);
  margin-bottom: 18px;
}
.card__icon--about { color: #3b5bdb; }
.card__icon--config { color: #1664ff; }
.card__icon--codex { color: #d9730d; }
.card__icon--faq { color: #7048e8; }
.card h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 8px; color: var(--text); }
.card p { font-size: 14px; color: var(--muted); margin: 0 0 18px; line-height: 1.65; }
.card__more { font-size: 14px; font-weight: 500; color: var(--primary); }

.articles { display: grid; }

.article-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 18px;
  border-radius: var(--r);
  transition: background 0.15s;
}
.article-row:hover { background: var(--hover); }
.article-row__title { font-weight: 500; font-size: 15.5px; color: var(--fg); }
.article-row__desc { font-size: 13.5px; color: #646a73; margin-top: 3px; }
.article-row__meta { margin-left: auto; font-size: 13px; color: #646a73; white-space: nowrap; }
.article-row:hover .article-row__meta { color: var(--primary); }

/* ---------- 文档卡片 ---------- */

.doc-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 28px; }
.doc-card {
  padding: 22px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.doc-card:hover { border-color: rgba(22, 100, 255, 0.35); box-shadow: var(--shadow); transform: translateY(-2px); }
.doc-card h3 { font-size: 16px; font-weight: 600; margin: 0 0 8px; line-height: 1.5; color: var(--text); }
.doc-card span { font-size: 13px; color: #646a73; }

/* ---------- 上下篇 / 反馈 ---------- */

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 56px 0 0; }
.pager__item {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  transition: border-color 0.15s, background 0.15s;
}
.pager__item:hover { border-color: rgba(22, 100, 255, 0.35); background: #fbfcff; }
.pager__item span { display: block; font-size: 12.5px; color: #646a73; margin-bottom: 4px; }
.pager__item b { font-size: 15px; font-weight: 500; color: var(--fg); }
.pager__next { text-align: right; }

.feedback {
  margin: 40px 0 0;
  padding: 22px 24px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  background: #f8f9fb;
  font-size: 14px;
  color: var(--muted);
}
.feedback__ask {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.feedback__ask b { color: var(--body); font-weight: 600; font-size: 15px; }
.feedback__btns { display: flex; gap: 10px; }
.fb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.fb-btn:hover { color: var(--primary); border-color: rgba(22,100,255,.4); background: #f7faff; }
.fb-btn svg { flex: none; }
.feedback__done { color: var(--body); font-weight: 500; padding: 2px 0; }
.feedback__extra {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
}
.feedback__extra a { color: var(--primary); }
.feedback__extra .dot { color: #d0d0d0; }
.feedback b { color: var(--fg); font-weight: 600; }
.feedback a { color: var(--primary); }

/* ---------- 页脚 ---------- */

.footer { border-top: 1px solid var(--line); margin-top: 64px; padding: 36px 0 48px; font-size: 13.5px; color: #646a73; }
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer a:hover { color: var(--primary); }

/* ---------- 响应式 ---------- */

@media (max-width: 900px) {
  .nav__links { display: none; }
  .doc-title { font-size: 30px; }
  .hero { padding: 48px 0 32px; }
  .hero h1 { font-size: 34px; }
  .hero p { font-size: 16px; }
  .cards { grid-template-columns: 1fr; }
  .columns { grid-template-columns: 1fr !important; }
  .prose h2 { font-size: 22px; }
  .doc-cards { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 1fr; }
}

.nav__icon {
  margin-left: 14px;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: none; padding: 0;
  border-radius: var(--r-sm);
  color: var(--muted);
  cursor: pointer;
  transition: color .2s, background .2s;
}
.nav__icon:hover { color: var(--fg); background: var(--hover); }

/* ---------- 侧栏头部 / 工具条 / 专注模式 ---------- */

.sidebar__home {
  display: block;
  padding: 0 10px 10px;
  font-size: 13px;
  color: #646a73;
}
.sidebar__home:hover { color: var(--primary); }

.doc-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
}
.tool:hover { color: var(--primary); border-color: rgba(22,100,255,.35); background: #fbfcff; }
.tool svg { flex: none; }

[data-hide-left] .shell { grid-template-columns: 0 minmax(0, 1fr) 200px; }
[data-hide-left] .main { padding-left: 0; }
[data-hide-left] .sidebar { opacity: 0; visibility: hidden; pointer-events: none; }

[data-hide-right] .shell { grid-template-columns: 200px minmax(0, 1fr) 0; }
[data-hide-right] .main { padding-right: 0; }
[data-hide-right] .toc { opacity: 0; visibility: hidden; pointer-events: none; }

[data-hide-left][data-hide-right] .shell { grid-template-columns: 0 minmax(0, 1fr) 0; }
[data-hide-left][data-hide-right] .main { padding-left: 0; padding-right: 0; }

/* 侧栏标题行 + 收起把手 */
.sidebar__head, .toc__head {
  display: flex; align-items: center;
  height: 26px; margin-bottom: 10px;
  position: sticky; top: 0; z-index: 3;
  background: var(--bg);
  padding-bottom: 10px;
  height: auto;
  box-sizing: content-box;
}
.sidebar__head { gap: 6px; justify-content: flex-start; }
.toc__head { justify-content: space-between; }
.sidebar__head .sidebar__title, .toc__head .toc__title {
  margin: 0; padding: 0; font-size: 11.5px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: #646a73;
}



/* 收起后在页面边缘出现的展开把手 */

/* 侧栏开关：常驻在面包屑条里，随条一起吸顶 */
.panel-toggle {
  position: relative;
  flex: none;
  width: 26px;
  height: 26px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid transparent;   /* 默认无边框、无底色，只是个淡图标 */
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: #a8adb5;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s, box-shadow .15s;
}
.panel-toggle:hover { color: var(--primary); background: var(--hover); }
.panel-toggle:active { background: #e6eaf1; }
/* 收起态稍微深一点，方便找得到 */
.panel-toggle.is-off { color: #8f959e; }
.panel-toggle--left { margin-right: 6px; }
.panel-toggle--right { margin-left: auto; }

/* 标题给悬浮按钮让位 */

@media (max-width: 900px) {
  .doc-tools { margin-left: 0; width: 100%; }
  .doc-meta { flex-wrap: wrap; }
}


/* 收起时面包屑让出把手的位置 */


/* ---------- 栏目页：区块标题 + 多列链接（参考飞书帮助中心） ---------- */

.cat-group {
  padding: 30px 0 34px;
  border-bottom: 1px solid var(--line-2);
}
.cat-group:last-child { border-bottom: 0; }
.cat-title {
  display: block;
  font-size: 26px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--body);
  margin-bottom: 18px;
}
.cat-title:hover { color: var(--primary); }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 40px;
}
.cat-grid a {
  position: relative;
  padding-left: 14px;
  font-size: 16px;
  line-height: 1.9;
  color: var(--body);
}
.cat-grid a::before {
  content: "·";
  position: absolute;
  left: 2px;
  color: #b6b6b6;
}
.cat-grid a:hover { color: var(--primary); }

@media (max-width: 900px) {
  .cat-grid { grid-template-columns: 1fr; }
  .cat-title { font-size: 21px; }
}

/* ---------- 左侧目录树（参考飞书帮助中心） ---------- */

.tree-node { position: relative; margin-bottom: 2px; }

.tree-row {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  padding: 4px 2px;
  border-radius: 8px;
  transition: background .15s;
}
.tree-row:hover { background: var(--hover); }

.tree-caret {
  width: 18px;
  height: 32px;   /* 与单行条目等高，箭头正好落在第一行的视觉中线上 */
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  color: #9aa0a6;
  transition: transform .18s ease, color .15s;
}
.tree-caret::before {
  content: "";
  width: 0; height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}
.tree-caret--leaf::before { display: none; }
.tree-caret:hover { color: var(--primary); }
.tree-node.is-open > .tree-row > .tree-caret { transform: rotate(90deg); }

.tree-link {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  border-radius: 8px;
  overflow: hidden;
}
/* 截断放在内层：flex 子项上的 line-clamp 在部分浏览器会失效 */
.tree-link-t {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.tree-link:hover { color: var(--body); }
.tree-link.is-active {
  color: var(--primary);
  font-weight: 500;
  background: #eaf1ff;
}

.tree-children { display: none; margin: 2px 0 4px 9px; padding-left: 6px; }
.tree-node.is-open > .tree-children { display: block; }

/* 右侧目录：竖线 + 选中蓝色左条 */
.toc a {
  border-left: 1px solid var(--line-2);
  color: #6b7076;
  padding-top: 6px;
  padding-bottom: 6px;
  transition: color .15s, border-color .15s;
}
.toc a:hover { color: var(--body); }
.toc a.is-active {
  color: var(--primary);
  border-left: 2px solid var(--primary);
  margin-left: -1px;
  font-weight: 500;
}

/* 顶层叶子项（独立文章）文字对齐到三角那一列；深层叶子保持与兄弟文字同列 */
.tree-node[data-depth="0"].is-leaf > .tree-row { gap: 0; }
.tree-node[data-depth="0"].is-leaf > .tree-row > .tree-caret--leaf { width: 0; }
.tree-node[data-depth="0"].is-leaf > .tree-row > .tree-link { padding-left: 10px; }

/* ==========================================================================
   移动端 / 平板适配（≤900px 单栏，侧栏改为抽屉）
   ========================================================================== */

/* 唯一断点：≤1120 进入「窄屏模式」——单栏 + 抽屉 + 隐藏本页目录 */
@media (max-width: 1120px) {
  /* 右侧「本篇目录」改成从右滑出的抽屉，按钮保留 */
  .toc {
    display: block;
    position: fixed;
    top: calc(var(--nav-h) + 52px);
    right: 0;
    bottom: 0;
    width: min(280px, 82vw);
    max-height: none;
    padding: 14px 16px 40px;
    background: #fff;
    border-left: 1px solid var(--line-2);
    box-shadow: -14px 0 40px -20px rgba(3, 8, 10, 0.4);
    transform: translateX(0);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 60;
    overflow-y: auto;
  }
  [data-hide-right] .toc {
    transform: translateX(102%);
    pointer-events: none;
    box-shadow: none;
  }
  html:not([data-hide-right]) .shell::after {
    content: "";
    position: fixed;
    inset: calc(var(--nav-h) + 52px) 0 0 0;
    background: rgba(3, 8, 10, 0.3);
    z-index: 50;
  }
  .shell,
  [data-hide-left] .shell,
  [data-hide-right] .shell,
  [data-hide-left][data-hide-right] .shell {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .main,
  [data-hide-left] .main,
  [data-hide-right] .main { padding-left: 24px; padding-right: 24px; }
}

@media (max-width: 1120px) {
  /* 左栏改抽屉 */
  .sidebar {
    display: block;          /* 覆盖上面旧的 display:none */
    position: fixed;
    top: calc(var(--nav-h) + 52px);
    left: 0;
    bottom: 0;
    width: min(286px, 80vw);
    max-height: none;
    padding: 14px 10px 40px;
    background: #fff;
    border-right: 1px solid var(--line-2);
    box-shadow: 12px 0 40px -18px rgba(3, 8, 10, 0.35);
    transform: translateX(0);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 60;
    overflow-y: auto;
  }
  [data-hide-left] .sidebar {
    transform: translateX(-101%);
    opacity: 1;
    visibility: visible;
    pointer-events: none;
  }
  [data-hide-left] .sidebar { box-shadow: none; }

  /* 抽屉打开时的遮罩 */
  html:not([data-hide-left]) .shell::before {
    content: "";
    position: fixed;
    inset: calc(var(--nav-h) + 52px) 0 0 0;
    background: rgba(3, 8, 10, 0.3);
    z-index: 50;
  }

  .doc-title { font-size: 26px; line-height: 1.35; }
  .prose .h-l1, .prose .h-l2 { font-size: 19px; margin: 32px 0 12px; }
  .prose .h-l3, .prose .h-l4 { font-size: 17px; }
  .table-wrap { margin: 26px 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { margin: 0; }

.prose table { font-size: 13.5px; }
  .pagebar { height: 48px; }
  .crumbs { font-size: 12.5px; }
  .feedback__ask { flex-direction: column; align-items: flex-start; gap: 12px; }
  /* 飞书分栏在窄屏强制单列，否则并排图片会撑破容器 */
  .columns { grid-template-columns: 1fr !important; gap: 18px; }
  .pager { grid-template-columns: 1fr; }
  .hero { padding: 36px 0 24px; }
  .hero h1 { font-size: 30px; }
}

/* 防止列表内的代码块把分栏撑宽 */
.prose li, .prose ol, .prose ul { min-width: 0; }
.prose pre, .prose .code { max-width: 100%; }
.columns > div { overflow: hidden; }

/* ---------- 移动端汉堡菜单 ---------- */

.nav__burger {
  display: none;
  margin-left: 8px;
  width: 36px; height: 36px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  position: relative;
  flex: none;
}
.nav__burger span {
  position: absolute;
  left: 9px; right: 9px;
  height: 1.6px;
  border-radius: 2px;
  background: var(--body);
  transition: transform .2s ease, opacity .2s ease, top .2s ease;
}
.nav__burger span:nth-child(1) { top: 12px; }
.nav__burger span:nth-child(2) { top: 17.2px; }
.nav__burger span:nth-child(3) { top: 22.4px; }
.nav__burger.is-open span:nth-child(1) { top: 17.2px; transform: rotate(45deg); }
.nav__burger.is-open span:nth-child(2) { opacity: 0; }
.nav__burger.is-open span:nth-child(3) { top: 17.2px; transform: rotate(-45deg); }

.nav__menu {
  position: fixed;
  transform-origin: top center;
  top: var(--nav-h);
  left: 0; right: 0;
  z-index: 55;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 16px 32px -20px rgba(3, 8, 10, 0.3);
  padding: 6px 16px 14px;
  max-height: calc(100vh - var(--nav-h));
  overflow-y: auto;
}
.nav__menu a {
  display: block;
  padding: 13px 6px;
  font-size: 15px;
  color: var(--body);
  border-bottom: 1px solid var(--line);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .42s cubic-bezier(.16, 1, .3, 1),
              transform .42s cubic-bezier(.16, 1, .3, 1);
}
.nav__menu.is-open a { opacity: 1; transform: translateY(0); }
.nav__menu a:last-child { border-bottom: 0; }
.nav__menu a:hover, .nav__menu a:active { color: var(--primary); }

@media (max-width: 900px) {
  .nav__burger { display: block; }
}

/* 反馈：投完只留一行客服入口（对齐飞书） */
.feedback__done { display: block; color: var(--body); font-weight: 500; }
.feedback__done a { color: var(--primary); margin-left: 2px; }

/* 长 URL / 长串代码在正文里强制可断行，避免撑破容器 */
.prose p, .prose li, .prose blockquote, .prose td, .prose th,
.prose .callout p, .prose .h-l1, .prose .h-l2, .prose .h-l3, .prose .h-l4 {
  overflow-wrap: anywhere;
}

/* 分类页：标题下直接是三列链接，与飞书一致 */
.main > .cat-grid { margin-top: 18px; }

/* 没有「本篇目录」的页面：不保留那一列 */
.shell--no-toc { grid-template-columns: 200px minmax(0, 1fr); }
[data-hide-left] .shell--no-toc { grid-template-columns: minmax(0, 1fr); }
[data-hide-left][data-hide-right] .shell--no-toc { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1120px) {
  .shell--no-toc,
  [data-hide-left] .shell--no-toc { grid-template-columns: minmax(0, 1fr) !important; }
}

/* 无目录页在单列布局时，收起的侧栏要脱离布局（否则会顶下正文） */
[data-hide-left] .shell--no-toc > .sidebar { display: none; }

/* 阅读时长前的时钟图标 */
.meta-read {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.meta-read svg { flex: none; opacity: .85; }

/* ---------- 导航搜索胶囊 -------------- */
.nav__search {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  width: 120px;
  padding: 0 10px;
  margin-right: 0;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid transparent;
  color: var(--muted);
  transition: background .15s, border-color .15s;
}
.nav__search:hover { background: #eef1f7; }
.nav__search:focus-within { background: #fff; border-color: rgba(22, 100, 255, .45); }
.nav__search-ico { flex: none; }
.nav__search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--fg);
}
.nav__search input::placeholder { color: var(--muted); }

.nav__search-drop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 400px;
  max-height: min(64vh, 440px);
  overflow-y: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 20px 50px -18px rgba(3, 8, 10, .35);
  z-index: 120;
}
.nav__search-hint { padding: 18px 12px; text-align: center; font-size: 13px; color: var(--muted); }
.nav__search-hit {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
}
/* 选择器要压过 .nav__right a 的 nowrap，否则结果不换行 */
.nav__right .nav__search-hit { white-space: normal; }
.nav__search-drop { overflow-x: hidden; }
.nav__search-hit.is-active, .nav__search-hit:hover { background: var(--hover); }
.nav__search-hit-t { display: block; font-size: 13.5px; font-weight: 600; color: var(--fg); }
.nav__search-hit-x { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.5; }

/* 文末「微信扫码进群」的二维码：跟标题左对齐，不居中 */
.prose .qr-figure img { margin: 22px 0; }
.prose .qr-figure figcaption { text-align: left; }

/* 手机端导航放不下搜索框（会挤掉登录按钮和汉堡），隐藏。
   放在文件末尾是为了压过后面的 .nav__search 基础样式 */
@media (max-width: 900px) {
  .nav__search { display: none !important; }
}

/* ---------- 正文图片放大 ---------- */
.prose img { transition: opacity .15s; }
.prose img:hover { opacity: .92; }
.imgview {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center;
  padding: 32px;
  background: rgba(8, 11, 16, .82);
  opacity: 0; transition: opacity .16s;
  cursor: zoom-out;
}
.imgview.is-open { opacity: 1; }
.imgview img {
  max-width: 100%; max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6);
  transform: scale(.97); transition: transform .16s;
}
.imgview.is-open img { transform: none; }
.imgview__close {
  position: absolute; top: 18px; right: 22px;
  width: 40px; height: 40px;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff; font-size: 24px; line-height: 1;
  cursor: pointer;
}
.imgview__close:hover { background: rgba(255, 255, 255, .26); }

/* ---------- 手机菜单里的搜索 ---------- */
.nav__menu-search {
  display: flex; align-items: center; gap: 8px;
  margin: 8px 6px 10px;
  padding: 0 12px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
}
.nav__menu-search input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: none;
  font: inherit; font-size: 15px; color: var(--fg);
}
.nav__menu-results { margin: 0 6px 8px; }
.nav__menu-results .nav__search-hit { padding: 10px 12px; }
