/* =========================================================
   LabCTO · 站点层：页头 / 首页 / 文档 / 搜索 / AI / 页脚
   ========================================================= */

/* ---------- 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  flex: none;
}

.brand:hover { color: var(--text); }

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8 55%, #0e7490);
  box-shadow: 0 4px 12px -4px rgba(37, 99, 235, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.brand-mark .icon {
  width: 19px;
  height: 19px;
  stroke-width: 1.9;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-text span {
  font-size: 10.5px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  /* 导航收成「首页 + 知识库 + 工具箱」三项后不再需要横向滚动兜底；
     这里必须是 visible，否则绝对定位的下拉菜单会被裁掉 */
  min-width: 0;
  overflow: visible;
}

.nav-link {
  position: relative;
  flex: none;
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s var(--ease);
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg-sunken);
}

.nav-link.is-active {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex: none;
}

/* 搜索入口：一个胶囊吃掉「搜索按钮 + AI 按钮」，顶栏只留一个控制 */
.search-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 196px;
  height: 34px;
  padding: 0 8px 0 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-faint);
  font-size: 12.5px;
  transition: all 0.15s var(--ease);
}

.search-pill:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-muted);
  box-shadow: var(--shadow-xs);
}

.search-pill .icon {
  flex: none;
  width: 15px;
  height: 15px;
}

.search-pill span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-align: left;
  white-space: nowrap;
}

.search-pill .kbd {
  flex: none;
  min-width: 19px;
  height: 19px;
  font-size: 10.5px;
}

@media (max-width: 1080px) {
  /* 窄屏只留放大镜，胶囊退化成图标按钮，给导航和登录让位 */
  .search-pill {
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  .search-pill span,
  .search-pill .kbd { display: none; }
}

/* ---------- 顶栏分组菜单：知识库 / 工具箱 ---------- */
.nav-group {
  position: relative;
  flex: none;
}

.nav-link--group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-link--group .icon {
  width: 13px;
  height: 13px;
  opacity: 0.55;
  transition: transform 0.18s var(--ease);
}

.nav-group:hover .nav-link--group .icon,
.nav-group.is-open .nav-link--group .icon {
  transform: rotate(180deg);
  opacity: 0.9;
}

.nav-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  display: none;
  width: 330px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md);
}

.nav-menu--tight { width: 268px; }

/* 工作手册只有两本，菜单不必撑到 330 宽；280 刚好让一句说明不被篇数顶断 */
.nav-menu--manual { width: 280px; }

/* 说明是第二行小字，篇数跟第一行的名称对齐，不跟着掉到两行中间 */
.nav-menu--manual .nav-menu__count { align-self: flex-start; margin-top: 4px; }

/* 用 display 切换而不是透明度过渡：菜单要「立刻」出现，
   过渡态在低帧率或后台标签页里容易卡住，读者会以为没点开 */
.nav-group:hover > .nav-menu,
.nav-group.is-open > .nav-menu,
.nav-group:focus-within > .nav-menu {
  display: block;
}

/* 按钮与菜单之间的 6px 空隙放一条透明缓冲，鼠标穿过去时不会误关 */
.nav-group > .nav-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -8px;
  height: 8px;
}

.nav-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--text-soft);
  transition: background 0.14s var(--ease), color 0.14s var(--ease);
}

.nav-menu__item:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.nav-menu__item.is-active,
.nav-menu__item.is-active:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.nav-menu__icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 7px;
  background: var(--bg-subtle);
  color: var(--text-faint);
}

.nav-menu__item.is-active .nav-menu__icon {
  background: var(--bg-elevated);
  color: var(--brand);
}

.nav-menu__icon .icon { width: 14px; height: 14px; }

.nav-menu__body {
  flex: 1;
  min-width: 0;
  overflow: hidden; /* 松开就让长描述把右侧篇数挤出菜单 */
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-menu__name {
  display: block;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  /* 菜单标题一律单行：超长截断，完整内容放在 title 属性里悬停可见 */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-menu__desc {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-menu__count {
  flex: none;
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
}

.nav-menu__item--all {
  margin-top: 4px;
  padding-top: 9px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 7px 7px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.nav-menu__item--all > .icon {
  width: 13px;
  height: 13px;
  color: var(--text-faint);
}

.nav-menu__item--all:hover > .icon { color: var(--brand); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  padding: 0;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.15s var(--ease);
}

.icon-btn:hover {
  background: var(--bg-sunken);
  color: var(--text);
}

.icon-btn .icon { width: 18px; height: 18px; }

.mobile-toggle { display: none; }

/* 深浅色图标切换 */
.theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: block; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  box-shadow: var(--shadow-xs);
}

.eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.16);
  animation: pulse-soft 2.4s infinite;
}




/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  padding: 32px 0 24px;
  margin-top: 0;
}

.footer-grid {
  display: grid;
  /* 品牌 + 知识库 / 工作手册 / 能力 / 关于，工作手册单独一列不再混进知识库 */
  grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr));
  gap: 32px;
  margin-bottom: 24px;
}

.footer-brand p {
  margin-top: 9px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-faint);
  max-width: 300px;
}

.footer-col h4 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.footer-col a,
.footer-col span {
  display: block;
  font-size: 12.5px;
  color: var(--text-muted);
  padding: 2px 0;
}

.footer-col a:hover { color: var(--brand); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-faint);
}

/* ---------- 文档页 ---------- */
.docs-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 196px;
  gap: clamp(20px, 1.9vw, 28px);
  padding-top: 24px;
  padding-bottom: 56px;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  max-height: calc(100vh - var(--header-h) - 32px);
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  margin-bottom: 4px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* 侧栏标题（空间名）单行省略，篇数徽标不被长名字挤走 */
.sidebar-title > .icon { flex: none; }

.sidebar-title__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tree-item > a,
.tree-item > span {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-muted);
  border-left: 2px solid transparent;
}

/* 目录里的文档标题单行显示，超长省略；完整标题挂在链接的 title 上 */
.tree-item__text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-item > a:hover {
  color: var(--text);
  background: var(--bg-sunken);
}

.tree-item.is-active > a {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 600;
  border-left-color: var(--brand);
}

.tree-item.is-folder > span {
  font-weight: 600;
  color: var(--text-soft);
  font-size: 12.5px;
  margin-top: 8px;
  padding-left: 8px;
  letter-spacing: 0.01em;
}

.tree-children {
  list-style: none;
  margin: 2px 0 2px 12px;
  padding: 0 0 0 8px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.doc-main { min-width: 0; max-width: var(--prose-max); }

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-faint);
  margin-bottom: 14px;
}

.breadcrumb a { color: var(--text-faint); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb .sep { opacity: 0.5; }
.breadcrumb .current { color: var(--text-muted); }

.doc-header {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.doc-header h1 {
  font-size: clamp(24px, 2.4vw, 30px);
  letter-spacing: -0.03em;
  line-height: 1.28;
  margin-bottom: 10px;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 12.5px;
  color: var(--text-faint);
}

.doc-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.doc-meta .icon { width: 14px; height: 14px; }

.prose {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-soft);
}

.prose > *:first-child { margin-top: 0; }

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  color: var(--text);
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.prose h2 {
  font-size: 21px;
  margin: 34px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.02em;
}

.prose h3 {
  font-size: 17px;
  margin: 26px 0 8px;
}

.prose h4 {
  font-size: 15px;
  margin: 20px 0 7px;
}

.prose p { margin: 14px 0; }

.prose a {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--brand) 35%, transparent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.prose a:hover { text-decoration-color: var(--brand); }

.prose ul,
.prose ol {
  margin: 14px 0;
  padding-left: 22px;
}

.prose li { margin: 5px 0; }
.prose li > p { margin: 0; }
.prose li::marker { color: var(--text-faint); }

.prose strong { color: var(--text); font-weight: 620; }

.prose blockquote {
  margin: 18px 0;
  padding: 2px 0 2px 15px;
  border-left: 3px solid var(--border-strong);
  color: var(--text-muted);
  font-size: 14.5px;
}

.prose blockquote p { margin: 10px 0; }

.prose code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--text);
}

.prose .code-block code {
  padding: 0;
  border: 0;
  background: transparent;
  color: #dbe4f3;
}

.prose img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 16px 0;
}

.prose mark {
  background: rgba(250, 204, 21, 0.35);
  color: inherit;
  padding: 1px 3px;
  border-radius: 3px;
}

.prose hr { margin: 28px 0; }

.prose .task {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
}

/* ---------- 目录（右侧） ---------- */
.docs-toc {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - var(--header-h) - 32px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.docs-toc::-webkit-scrollbar { width: 4px; }
.docs-toc::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }

.toc-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--border);
}

.toc-list a {
  display: block;
  padding: 5px 0 5px 11px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted);
  transition: all 0.15s var(--ease);
  /* 本页目录的条目也是菜单：单行、超长省略，title 里放全文 */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toc-list a:hover { color: var(--text); }

.toc-list a.is-active {
  color: var(--brand);
  border-left-color: var(--brand);
  font-weight: 600;
}

.toc-list .depth-3 a { padding-left: 24px; font-size: 12px; }

.doc-toc-inline {
  display: none;
  margin: 0 0 26px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-subtle);
}

.doc-toc-inline > summary {
  display: flex;
  align-items: center;
  gap: 7px;
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
}

.doc-toc-inline > summary::-webkit-details-marker { display: none; }
.doc-toc-inline > summary .icon { width: 15px; height: 15px; color: var(--text-faint); }
.doc-toc-inline .toc-list { margin-top: 10px; }

.toc-card {
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 0;
  background: var(--bg-subtle);
}

.toc-card p {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 6px 0 10px;
}

.toc-card .btn { width: 100%; }

/* ---------- 反馈 / 翻页 ---------- */
/* 文末收尾：反馈压成一条横栏（左问句 / 右按钮），不再用整块底色卡片 */
.feedback {
  display: block;
  margin-top: 32px;
  padding: 16px 0 0;
  border-top: 1px solid var(--border);
  background: none;
}

.feedback__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.feedback p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

/* 第三个动作退成文字按钮，靠颜色分层级，不再加竖线 */
.feedback-actions .btn-ghost {
  margin-left: 2px;
}

.feedback .btn.is-selected {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

/* 相关文档：两列细线列表，和首页目录用同一套语言 */
.doc-related { margin-top: 32px; }

.doc-related__head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.doc-related__head h2 {
  flex: none;
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
}

.doc-related__rule {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.doc-related__head a {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--text-faint);
}

.doc-related__head a:hover { color: var(--brand); }
.doc-related__head a .icon { width: 12px; height: 12px; }

.doc-related__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 26px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.doc-related__list a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 6px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-soft);
  transition: all 0.15s var(--ease);
}

.doc-related__list a:hover { background: var(--bg-subtle); }

.doc-related__list a:hover { color: var(--brand); }

.doc-related__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-related__meta {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}

/* ---------- 搜索页 ---------- */
.search-page {
  padding: 32px 0 56px;
  max-width: 860px;
  margin: 0 auto;
}

.search-page h1 {
  font-size: 30px;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.search-hero-form {
  display: flex;
  gap: 10px;
  margin: 0 0 10px;
}

/* 搜索框 + 结果统计吸顶：页面滚动时只有下方结果列表滚动，翻页不移动搜索框 */
.search-sticky {
  position: sticky;
  top: calc(var(--header-h) + 8px);
  z-index: 40;
  background: var(--bg);
  padding: 12px 0 12px;
  margin: 0 0 4px;
  border-bottom: 1px solid var(--border);
}

.search-sticky .search-hints { margin-top: 0; }

.search-hero-form .input {
  height: 50px;
  font-size: 16px;
  padding: 0 18px;
  border-radius: 12px;
  box-shadow: var(--shadow-xs);
}

.search-hero-form .btn { height: 50px; border-radius: 12px; padding: 0 24px; }

.search-hints {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-faint);
}

.chip {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 12.5px;
  transition: all 0.15s var(--ease);
}

.chip:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
  transform: translateY(-1px);
}

.result-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* 搜索结果分页 */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 22px;
}

.pager-link {
  display: inline-flex;
  align-items: center;
  min-width: 34px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-soft);
  text-align: center;
  justify-content: center;
  transition: all 0.15s var(--ease);
}

a.pager-link:hover {
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 32%, transparent);
  background: var(--brand-soft);
}

.pager-link.is-current {
  color: var(--brand);
  font-weight: 650;
  border-color: color-mix(in srgb, var(--brand) 36%, transparent);
  background: var(--brand-soft);
}

.pager-link.is-disabled {
  opacity: 0.45;
  cursor: default;
}

.pager-ellipsis {
  color: var(--text-faint);
  padding: 0 2px;
}

.pager-info {
  font-size: 12.3px;
  color: var(--text-faint);
  margin-left: 8px;
}

.result-item {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  color: var(--text);
  transition: all 0.16s var(--ease);
}

.result-item:hover {
  color: var(--text);
  background: var(--bg-subtle);
  border-color: var(--border);
}

.result-item h3 {
  font-size: 15.5px;
  font-weight: 600;
  margin-bottom: 4px;
}

.result-item h3 mark {
  background: rgba(37, 99, 235, 0.16);
  color: var(--brand);
  padding: 0 2px;
  border-radius: 3px;
}

.result-item p {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-item p mark {
  background: rgba(250, 204, 21, 0.28);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

.result-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--text-faint);
}

/* ---------- 搜索弹窗 ---------- */
.modal[hidden] { display: none; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 12vh 16px 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 14, 26, 0.55);
  backdrop-filter: blur(4px);
  animation: fade-in 0.16s var(--ease);
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.search-dialog {
  position: relative;
  width: min(660px, 100%);
  max-height: 74vh;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: fade-up 0.2s var(--ease);
}

.search-dialog__input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.search-dialog__input .icon { color: var(--text-faint); width: 19px; height: 19px; }

.search-dialog__input input {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 15.5px;
  color: var(--text);
}

.search-dialog__input input:focus { outline: none; }

.search-results {
  overflow-y: auto;
  padding: 8px;
  min-height: 120px;
}

.search-group-label {
  padding: 8px 10px 4px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.search-result {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--text);
}

.search-result:hover,
.search-result.is-selected {
  color: var(--text);
  background: var(--brand-soft);
}

.search-result .icon {
  margin-top: 3px;
  color: var(--text-faint);
}

.search-result.is-selected .icon { color: var(--brand); }

.search-result__body { min-width: 0; }

.search-result__title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
}

.search-result__snippet {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-empty {
  padding: 28px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-faint);
}

.search-dialog__foot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  font-size: 11px;
  color: var(--text-faint);
}

.search-dialog__foot kbd { margin-right: 3px; }

/* ---------- AI 助手 ---------- */
.ai-fab {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: var(--ai-gradient);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 12px 30px -10px rgba(124, 58, 237, 0.6);
  transition: all 0.2s var(--ease);
}

.ai-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px -12px rgba(124, 58, 237, 0.75);
}

.ai-fab .icon { width: 18px; height: 18px; }

.ai-drawer[hidden], .ai-selection[hidden], .ai-selection-action[hidden], .ai-stop[hidden] { display: none; }

.ai-selection-action {
  position: fixed;
  z-index: 89;
  max-width: calc(100vw - 24px);
  padding: 9px 14px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.ai-selection-action:disabled { cursor: default; }
.ai-selection { margin-bottom: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.ai-selection__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text); }
.ai-selection blockquote { margin: 6px 0 0; max-height: 100px; overflow: auto; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 13px; color: var(--text-muted); }
.ai-document-title { display: block; margin: 6px 0; max-height: 60px; overflow: auto; overflow-wrap: anywhere; font-size: 13px; }
.ai-stop { margin-top: 8px; }
.ai-panel__head > div { min-width: 0; flex: 1; }
.ai-panel__head > button { flex-shrink: 0; }

.ai-drawer {
  position: fixed;
  inset: 0;
  z-index: 90;
}

.ai-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 14, 26, 0.32);
  backdrop-filter: blur(2px);
}

.ai-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  box-shadow: -24px 0 60px -30px rgba(0, 0, 0, 0.4);
  animation: slide-in 0.26s var(--ease);
}

@keyframes slide-in {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.ai-panel__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.ai-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(145deg, #3b82f6, #0e7490);
  box-shadow: 0 6px 14px -6px rgba(37, 99, 235, 0.7);
}

.ai-avatar .icon { width: 18px; height: 18px; }

.ai-panel__title {
  font-size: 14px;
  font-weight: 650;
}

.ai-panel__sub {
  font-size: 11.5px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 5px;
}

.ai-panel__sub .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.ai-panel__sub .dot.off { background: var(--text-faint); }

.ai-panel__close {
  margin-left: auto;
}

.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.ai-msg {
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fade-up 0.2s var(--ease);
}

.ai-msg--user { align-items: flex-end; }

.ai-bubble-user {
  max-width: 86%;
  padding: 9px 13px;
  border-radius: 12px 12px 3px 12px;
  background: var(--brand);
  color: #fff;
  font-size: 13.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ai-bubble-bot {
  font-size: 13.8px;
  line-height: 1.78;
  color: var(--text-soft);
}

.ai-bubble-bot p { margin: 8px 0; }
.ai-bubble-bot p:first-child { margin-top: 0; }
.ai-bubble-bot strong { color: var(--text); }
.ai-bubble-bot ul,
.ai-bubble-bot ol { margin: 8px 0; padding-left: 20px; }
.ai-bubble-bot li { margin: 3px 0; }
.ai-bubble-bot blockquote {
  margin: 10px 0;
  padding: 6px 12px;
  border-left: 3px solid var(--border-strong);
  color: var(--text-muted);
  font-size: 12.8px;
  background: var(--bg-subtle);
  border-radius: 0 6px 6px 0;
}
.ai-bubble-bot h3,
.ai-bubble-bot h4 {
  font-size: 14px;
  margin: 12px 0 4px;
}
.ai-bubble-bot code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-sunken);
  padding: 1px 4px;
  border-radius: 4px;
}

.ai-cite-ref {
  display: inline-grid;
  place-items: center;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  margin: 0 1px;
  border-radius: 4px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 9.5px;
  font-weight: 700;
  vertical-align: super;
  line-height: 1;
}

.ai-cites {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.ai-cite {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-subtle);
  font-size: 11.5px;
  color: var(--text-muted);
  transition: all 0.15s var(--ease);
}

.ai-cite:hover {
  border-color: var(--brand);
  color: var(--text);
  background: var(--brand-soft);
}

.ai-cite b {
  color: var(--text-soft);
  font-weight: 600;
  display: block;
  font-size: 11.8px;
}

.ai-cite .ai-cite__idx {
  flex: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 10px;
  font-weight: 700;
  color: var(--brand);
}

.ai-typing {
  display: inline-flex;
  gap: 4px;
  padding: 4px 0;
}

.ai-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  animation: blink 1.2s infinite;
}

.ai-typing i:nth-child(2) { animation-delay: 0.16s; }
.ai-typing i:nth-child(3) { animation-delay: 0.32s; }

@keyframes blink {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

.ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 18px 12px;
}

.ai-suggestions button {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 11.5px;
  transition: all 0.15s var(--ease);
}

.ai-suggestions button:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

.ai-composer {
  padding: 12px 14px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

.ai-composer__box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  transition: all 0.15s var(--ease);
}

.ai-composer__box:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
  background: var(--bg-elevated);
}

.ai-composer textarea {
  flex: 1;
  border: 0;
  background: transparent;
  resize: none;
  max-height: 120px;
  min-height: 24px;
  padding: 4px 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
}

.ai-composer textarea:focus { outline: none; }

.ai-send {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 0;
  background: var(--brand);
  color: #fff;
  transition: all 0.15s var(--ease);
}

.ai-send:hover { background: var(--brand-strong); }
.ai-send[disabled] { opacity: 0.4; cursor: not-allowed; }

.ai-footnote {
  margin-top: 8px;
  text-align: center;
  font-size: 10.5px;
  color: var(--text-faint);
}

/* ---------- 移动端 ---------- */
.mobile-drawer[hidden] { display: none; }

@media (max-width: 1400px) {
  .docs-shell {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 36px;
  }
  .docs-toc { display: none; }
  .doc-toc-inline { display: block; }
}

@media (max-width: 960px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-nav { display: none; }
  .mobile-toggle { display: grid; }
  .docs-shell { grid-template-columns: minmax(0, 1fr); padding-top: 16px; }
  .docs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-height: none;
    z-index: 95;
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    padding: 20px 14px;
    transform: translateX(-100%);
    transition: transform 0.25s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  body.drawer-open .docs-sidebar { transform: translateX(0); }
  body.drawer-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(9, 14, 26, 0.4);
    z-index: 94;
  }
  .doc-mobile-bar {
    position: sticky;
    top: var(--header-h);
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 -24px 16px;
    padding: 9px 24px;
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    font-size: 12.5px;
  }
  .doc-related__list { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .feedback__head { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 640px) {
  .container { padding: 0 18px; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .doc-header h1 { font-size: 26px; }
  .search-hero-form { flex-direction: column; }
  .search-hero-form .btn { width: 100%; }
  .ai-panel { width: 100%; }
  /* 手机上收成圆形图标球：胶囊带文字会压住正文最后几行 */
  .ai-fab {
    right: 14px;
    bottom: 14px;
    gap: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }
  .ai-fab .icon { width: 20px; height: 20px; }
  .prose { font-size: 15px; }
}

/* 文档页移动端目录按钮 */
.doc-mobile-bar { display: none; }

@media (max-width: 960px) {
  .doc-mobile-bar { display: flex; }
  .doc-mobile-bar button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-size: 12px;
  }
  .doc-mobile-bar .bar-title {
    margin-left: auto;
    color: var(--text-faint);
    max-width: 55%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ---------- 知识库总览 ---------- */
.overview-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.overview-head h1 {
  font-size: clamp(28px, 3.4vw, 38px);
  letter-spacing: -0.035em;
  margin: 14px 0 10px;
}

.overview-head p {
  font-size: 14.5px;
  max-width: 540px;
  line-height: 1.75;
}

.overview-actions {
  display: flex;
  gap: 8px;
  flex: none;
}

.overview-actions .kbd { margin-left: 2px; }

.overview-card {
  --sys: var(--brand);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  margin-bottom: 16px;
}

/* 总览页在两份工作手册前插一条分节标题，和知识库空间分开 */
.overview-sep {
  margin: 34px 0 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.overview-sep h2 {
  margin: 0 0 4px;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.overview-sep p { margin: 0; }

.overview-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.space-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--sys) 10%, transparent);
  color: var(--sys);
  margin-bottom: 16px;
}

.space-icon .icon { width: 15px; height: 15px; }

.overview-card__head .space-icon { margin: 0; flex: none; }

.overview-card__head h2 {
  font-size: 16px;
  letter-spacing: -0.01em;
}

.overview-card__head p {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.overview-count {
  margin-left: auto;
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.overview-card__body { padding: 14px 16px 16px; }

.overview-body-inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.overview-group__title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.overview-group__title .icon { width: 14px; height: 14px; flex: none; }

.overview-group__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 8px;
}

.doc-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px;
  border-radius: 7px;
  border: 1px solid transparent;
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.5;
  transition: color 0.16s var(--ease), background 0.16s var(--ease);
}

.doc-chip:hover {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 22%, transparent);
}

.doc-chip__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-chip .icon {
  margin-left: auto;
  width: 14px;
  height: 14px;
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.16s var(--ease);
}

.doc-chip:hover .icon { opacity: 1; transform: translateX(0); }

.overview-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px dashed var(--border-strong);
  background: var(--bg-subtle);
}

@media (max-width: 860px) {
  .overview-head { flex-direction: column; align-items: flex-start; gap: 18px; }
  .doc-grid { grid-template-columns: minmax(0, 1fr); }
  .overview-cta { flex-direction: column; align-items: flex-start; }
}

/* ---------- 会员中心 ---------- */
.account-wrap { padding: 40px 0 80px; }

.account-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 16px;
  background: linear-gradient(140deg, var(--brand), #0891b2);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.account-head__main { min-width: 0; }
.account-head__main h1 { font-size: 22px; letter-spacing: -0.02em; }
.account-head__main p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
}

.account-head__stats {
  margin-left: auto;
  display: flex;
  gap: 26px;
  flex: none;
}

.account-head__stats div {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.account-head__stats strong {
  font-size: 21px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.account-head__stats span { font-size: 11.5px; color: var(--text-faint); }

.account-grid {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.account-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 84px;
}

.account-nav a,
.account-logout {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 8px;
  background: none;
  font: inherit;
  font-size: 13.5px;
  color: var(--text-soft);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.account-nav a:hover,
.account-logout:hover { background: var(--bg-subtle); color: var(--text); }

.account-nav a.is-active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.account-nav a .icon,
.account-logout .icon { width: 16px; height: 16px; }

.account-nav .nav-count {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg-sunken);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.account-nav .divider { margin: 10px 0; }

.account-main .card { border-radius: var(--radius-lg); }

.fav-list { display: flex; flex-direction: column; }

.fav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 2px;
  border-bottom: 1px solid var(--border);
}

.fav-item:last-child { border-bottom: 0; }
.fav-item:hover strong { color: var(--brand); }

.fav-item__main { min-width: 0; flex: 1; }
.fav-item__main strong { display: block; font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.fav-item__main span { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; }

.fav-item__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.feedback-list { list-style: none; margin: 0; padding: 0; }
.feedback-list li { padding: 14px 0; border-bottom: 1px solid var(--border); }
.feedback-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.feedback-list p { margin: 8px 0 0; color: var(--text-soft); line-height: 1.7; }

/* 注册卡片加宽 */
.auth-card--wide { max-width: 520px; }

/* 顶栏用户菜单 */
.user-menu { position: relative; flex: none; }

.user-menu__btn {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
  max-width: 100%;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
  line-height: 1.2;
  color: var(--text-soft);
  white-space: nowrap;
  transition: all 0.15s var(--ease);
}

.user-menu__btn:hover { border-color: var(--border-strong); }

/* 名字单行显示，过长省略，避免把胶囊撑成两行 */
.user-menu__name {
  min-width: 0;
  max-width: 8em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu__avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--brand), #0891b2);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.user-menu__btn .icon { flex: none; width: 14px; height: 14px; }

.user-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-lg);
  z-index: 60;
}

.user-menu__panel[hidden] { display: none; }

.user-menu__panel a,
.user-menu__panel button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--text-soft);
  text-align: left;
  cursor: pointer;
}

.user-menu__panel a:hover,
.user-menu__panel button:hover { background: var(--bg-subtle); color: var(--text); }

.user-menu__panel .icon { width: 15px; height: 15px; }

.user-menu__head {
  padding: 8px 10px 9px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 5px;
}

.user-menu__head strong { display: block; font-size: 13px; }
.user-menu__head span { font-size: 11.5px; color: var(--text-faint); }

/* 文档页收藏按钮 */
/* 元信息与操作同一行：左信息右动作，标题区只占三行 */
.doc-head__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.doc-actions {
  display: flex;
  flex: none;
  gap: 8px;
}

.doc-fav.is-on {
  border-color: color-mix(in srgb, var(--warning) 40%, var(--border));
  color: var(--warning);
  background: rgba(217, 119, 6, 0.08);
}

@media (max-width: 860px) {
  .account-grid { grid-template-columns: minmax(0, 1fr); }
  .account-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .account-nav a, .account-logout { width: auto; }
  .account-head { flex-wrap: wrap; }
  .account-head__stats { margin-left: 0; width: 100%; justify-content: flex-start; }
  .account-head__stats div { align-items: flex-start; }
  .fav-item { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* =========================================================
   文档页（微信开放文档风格）：侧栏面板 + 可折叠目录树
   ========================================================= */
.docs-sidebar {
  padding: 14px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
.sidebar-count {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.sidebar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 2px 0 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-faint);
  font-size: 12.5px;
  cursor: pointer;
}
.sidebar-search:hover { border-color: var(--brand); color: var(--text-muted); }
.sidebar-search span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-search .kbd { margin-left: auto; flex: none; }

.tree-folder summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.tree-folder summary::-webkit-details-marker { display: none; }
.tree-folder summary:hover { color: var(--text); background: var(--bg-sunken); }
.tree-caret {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--text-faint);
  transition: transform 0.18s var(--ease);
}
.tree-folder[open] > summary .tree-caret { transform: rotate(90deg); }
.tree-folder[open] > summary { color: var(--text); }
.tree-folder__count {
  margin-left: auto;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--bg-sunken);
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 500;
  line-height: 18px;
}

/* 分组标题同样单行省略，篇数不许被长标题挤走 */
.tree-folder__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tree-folder .tree-children { margin: 2px 0 4px 14px; }


/* =========================================================
   布局升级 v2：更宽的容器 / 卡片化正文 / 现代化留白
   ========================================================= */

/* ---------- 全局页头 ---------- */
.site-header {
  box-shadow: 0 1px 0 color-mix(in srgb, var(--border) 70%, transparent),
              0 8px 24px -20px rgba(15, 23, 42, 0.4);
}

/* .header-inner 的间距见文件顶部基础样式与末尾的响应式档位，这里不再覆盖 */

/* ---------- 文档页：正文卡片化 ---------- */
.doc-main {
  min-width: 0;
  max-width: none;
  padding: clamp(22px, 2.2vw, 30px) clamp(22px, 2.2vw, 30px) 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-elevated);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 18px 40px -34px rgba(15, 23, 42, 0.5);
}

.doc-main .breadcrumb { margin-bottom: 16px; }

.doc-main .doc-header {
  padding-bottom: 16px;
  margin-bottom: 24px;
}

/* 正文：段落、列表、标题与表格统一占满卡片宽度
   之前按 78ch 限宽，中文字符比 ch 宽得多，导致正文只占卡片三分之二就折行，
   与满宽的表格、提示块错位。可读性交给卡片自身宽度（--prose-max: 900px）控制。 */
.prose { font-size: 16px; }
.prose > p,
.prose > ul,
.prose > ol,
.prose > blockquote,
.prose > h2,
.prose > h3,
.prose > h4 { max-width: 100%; }

.prose h2 {
  margin-top: 44px;
  padding-top: 4px;
}
.prose h2:first-child { margin-top: 0; }

.prose table { width: 100%; }

/* 文末收尾：反馈横栏 + 相关文档列表，全部走细线，不再叠卡片 */
.feedback {
  margin-top: 32px;
  padding: 14px 0;
  border: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: none;
}

/* ---------- 文档页：侧栏与目录面板 ---------- */
.docs-sidebar {
  padding: 16px 14px;
  border-radius: var(--radius-lg);
}

.docs-toc {
  padding: 18px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-xs);
  max-height: calc(100vh - var(--header-h) - 40px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.toc-card {
  padding: 14px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--brand-soft), transparent 72%);
  border: 1px solid color-mix(in srgb, var(--brand) 14%, var(--border));
}

/* 目录面板内部卡片不再叠加描边，避免框套框 */
.docs-toc .toc-card {
  border: 0;
  background: var(--bg-subtle);
}

/* ---------- 移动端适配 ---------- */
/* 移动端工具条直接贴满视口，原负 margin 在独立容器里会把页面撑宽 */
.doc-mobile-bar { margin-inline: 0; }

@media (max-width: 1400px) {
  .docs-shell {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 28px;
  }
}

@media (max-width: 960px) {
  .docs-shell { grid-template-columns: minmax(0, 1fr); padding-top: 16px; }
  .doc-main {
    padding: 22px 18px 28px;
    border-radius: var(--radius);
  }
  .prose > p { max-width: 100%; }
  .doc-mobile-bar { margin-inline: 0; }

  /* 规范引用的悬浮 tips 在窄屏没有 hover 场景，绝对定位还会把页面撑出横向滚动 */
  .spec-ref::after,
  .spec-ref::before { display: none; }
}

@media (min-width: 1680px) {
  .prose { font-size: 16.5px; }
}

/* =========================================================
   首页 v3：资料汇编式排版
   纸白底 + 正交细线 + 单一强调色；板块只留三屏：入口、体系、更新
   ========================================================= */
.home { background: var(--bg); }

/* ---------- 入口：居中式，参考 AI 落地页的大搜索框构成 ---------- */
.hm-hero {
  position: relative;
  padding: clamp(34px, 3vw, 50px) 0 clamp(26px, 2.2vw, 36px);
  background: var(--bg-subtle);
  overflow: hidden;
  text-align: center;
}

/* 氛围层：极淡的图纸网格，从中央向四周淡出，只做质感不做噪音 */
.hm-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.85;
  -webkit-mask-image: radial-gradient(75% 90% at 50% 0%, #000 0%, transparent 82%);
  mask-image: radial-gradient(75% 90% at 50% 0%, #000 0%, transparent 82%);
}

.hm-hero__inner { position: relative; z-index: 1; }

/* 底部刻度：全页唯一的装饰，取自图纸标尺 */
.hm-hero::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 5px;
  background-image: repeating-linear-gradient(to right, var(--border-strong) 0 1px, transparent 1px 18px);
  opacity: 0.38;
  pointer-events: none;
}

.hm-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

/* 章节标记：入口区唯一一处品牌色点缀，暗示「从这里开始」 */
.hm-eyebrow::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  background: var(--brand);
}

.hm-title {
  margin: 0;
  font-size: clamp(30px, 3.9vw, 54px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

/* 主标语下的副标题：四阶段一路读下来，比一行形容词更能说明「这个站怎么用」 */
.hm-subtitle {
  max-width: 30em;
  margin: 18px auto 0;
  font-size: clamp(16px, 1.75vw, 21px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--text-muted);
}

/* 四个阶段各自不拆行：窄屏换行时断在短语之间，不会出现「长于运 / 维」 */
.hm-subtitle span { white-space: nowrap; }

/* 手机上按「两段 + 两段」对折，不用让浏览器在任意字之间断 */
.hm-subtitle__br { display: none; }

@media (max-width: 640px) {
  .hm-subtitle__br { display: inline; }
}

.hm-lede {
  max-width: 34em;
  margin: 12px auto 0;
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--text-muted);
}

.hm-lede span { display: block; }

/* ---------- 居中大搜索框：输入 + 搜索 + 问 AI ---------- */
.hm-search {
  display: flex;
  align-items: center;
  gap: 6px;
  width: min(680px, 100%);
  margin: 24px auto 0;
  padding: 5px 5px 5px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.hm-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-ring);
}

.hm-search .icon {
  flex: none;
  width: 17px;
  height: 17px;
  color: var(--text-faint);
}

.hm-search input {
  flex: 1;
  min-width: 0;
  height: 42px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 14.5px;
}

.hm-search input:focus { outline: none; }
.hm-search input::placeholder { color: var(--text-faint); }

.hm-search__btn {
  flex: none;
  height: 42px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s var(--ease), transform 0.18s var(--ease);
}

.hm-search__btn:hover { background: var(--brand-strong); }

[data-theme="dark"] .hm-search__btn {
  background: #2563eb;
  color: #fff;
}

[data-theme="dark"] .hm-search__btn:hover { background: #1d4ed8; }

/* 问 AI：紫色渐变与搜索区分，呼应 AI 助手的品牌感 */
.hm-search__btn--ai {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ai-gradient);
}

.hm-search__btn--ai:hover {
  background: var(--ai-gradient-hover);
}

.hm-search__btn--ai { padding: 0 15px; }
.hm-search__btn--ai .icon { width: 14px; height: 14px; }

/* 窄屏：搜索框从「一行胶囊」改成「输入在上、两个按钮并排在下」，
   否则两个按钮会把输入框挤到只剩十几个字符 */
@media (max-width: 640px) {
  .hm-search {
    flex-wrap: wrap;
    padding: 8px;
    border-radius: 16px;
  }

  .hm-search > .icon { display: none; }

  .hm-search input {
    flex: 1 0 100%;
    order: -1;
    height: 36px;
    padding: 0 4px;
  }

  .hm-search__btn {
    flex: 1;
    height: 36px;
    padding: 0 12px;
  }
}

/* 热词：轻量文字链，不与按钮抢注意力 */
.hm-hint {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--text-faint);
}

.hm-hint a {
  margin: 0 2px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-soft);
  font-size: 12.5px;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.hm-hint a:hover {
  color: var(--brand);
  border-color: var(--brand);
}

/* ---------- 图签改横条：全宽统计带，数字用等宽字体 ---------- */
.hm-tag {
  width: min(1080px, 100%);
  margin: 32px auto 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
}

.hm-tag__head { display: none; }

.hm-tag__rows {
  display: flex;
  margin: 0;
}

.hm-tag__rows > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 16px 12px 12px;
}

.hm-tag__rows > div + div { border-left: 1px solid var(--border); }

.hm-tag dt {
  margin: 0;
  overflow: hidden;
  font-size: 12px;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hm-tag dd {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hm-tag dd i {
  margin-left: 3px;
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-faint);
}

.hm-tag dd.hm-tag__date {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-soft);
}

/* 入口唯一的次级动作：一条文字链，不与主按钮抢注意力 */
.hm-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 20px;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  font-size: 13px;
  font-weight: 550;
  color: var(--text-soft);
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.hm-more .icon {
  width: 13px;
  height: 13px;
  transition: transform 0.16s var(--ease);
}

.hm-more:hover { color: var(--brand); border-bottom-color: var(--brand); }
.hm-more:hover .icon { transform: translateX(3px); }

/* ---------- 板块 ---------- */
.hm-block { padding: clamp(34px, 3vw, 44px) 0; }

.hm-block--last { padding-bottom: clamp(40px, 4vw, 60px); }

.hm-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.hm-head h2 {
  flex: none;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.hm-head__rule {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.hm-head__link {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-muted);
}

.hm-head__link:hover { color: var(--brand); }
.hm-head__link .icon { width: 13px; height: 13px; }

/* ---------- 六套体系：3 列卡片网格，一屏收全 ---------- */
.hm-sys {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.hm-sys__col {
  --sys: #2563eb;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px 16px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.18s var(--ease);
}

.hm-sys__col:hover {
  border-color: color-mix(in srgb, var(--sys) 34%, var(--border));
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.hm-sys__col[data-tone="blue"] { --sys: #2563eb; }
.overview-card[data-tone="blue"] { --sys: #2563eb; }
.hm-sys__col[data-tone="green"] { --sys: #059669; }
.overview-card[data-tone="green"] { --sys: #059669; }
.hm-sys__col[data-tone="teal"] { --sys: #0f766e; }
.overview-card[data-tone="teal"] { --sys: #0f766e; }
.hm-sys__col[data-tone="violet"] { --sys: #7c3aed; }
.overview-card[data-tone="violet"] { --sys: #7c3aed; }
.hm-sys__col[data-tone="purple"] { --sys: #9333ea; }
.overview-card[data-tone="purple"] { --sys: #9333ea; }
.hm-sys__col[data-tone="amber"] { --sys: #b45309; }
.overview-card[data-tone="amber"] { --sys: #b45309; }
.hm-sys__col[data-tone="rose"] { --sys: #be123c; }
.overview-card[data-tone="rose"] { --sys: #be123c; }
.hm-sys__col[data-tone="slate"] { --sys: #475569; }
.overview-card[data-tone="slate"] { --sys: #475569; }

[data-theme="dark"] .hm-sys__col[data-tone="blue"] { --sys: #7fb0ff; }
[data-theme="dark"] .overview-card[data-tone="blue"] { --sys: #7fb0ff; }
[data-theme="dark"] .hm-sys__col[data-tone="green"] { --sys: #34d399; }
[data-theme="dark"] .overview-card[data-tone="green"] { --sys: #34d399; }
[data-theme="dark"] .hm-sys__col[data-tone="teal"] { --sys: #5eead4; }
[data-theme="dark"] .overview-card[data-tone="teal"] { --sys: #5eead4; }
[data-theme="dark"] .hm-sys__col[data-tone="violet"] { --sys: #c4b5fd; }
[data-theme="dark"] .overview-card[data-tone="violet"] { --sys: #c4b5fd; }
[data-theme="dark"] .hm-sys__col[data-tone="purple"] { --sys: #d8b4fe; }
[data-theme="dark"] .overview-card[data-tone="purple"] { --sys: #d8b4fe; }
[data-theme="dark"] .hm-sys__col[data-tone="amber"] { --sys: #fcd34d; }
[data-theme="dark"] .overview-card[data-tone="amber"] { --sys: #fcd34d; }
[data-theme="dark"] .hm-sys__col[data-tone="rose"] { --sys: #fda4af; }
[data-theme="dark"] .overview-card[data-tone="rose"] { --sys: #fda4af; }
[data-theme="dark"] .hm-sys__col[data-tone="slate"] { --sys: #cbd5e1; }
[data-theme="dark"] .overview-card[data-tone="slate"] { --sys: #cbd5e1; }

/* 卡头：图标 + 标题同一行，图标用体系色的 10% 底 */
.hm-sys__top {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 7px;
}

.hm-sys__ic {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--sys) 10%, transparent);
  color: var(--sys);
}

.hm-sys__ic .icon { width: 15px; height: 15px; }

.hm-sys__col h3 {
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.hm-sys__col h3 a { color: var(--text); }
.hm-sys__col h3 a:hover { color: var(--sys); }

.hm-sys__desc {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hm-sys__list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.hm-sys__list li {
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

.hm-sys__list li:last-child { border-bottom: 0; }

.hm-sys__list a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  font-size: 13px;
  color: var(--text-soft);
  transition: color 0.15s var(--ease);
}

.hm-sys__list a:hover { color: var(--sys); }

.hm-sys__list a .t {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hm-sys__list a .n {
  flex: none;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
}

.hm-sys__more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  /* 各卡片条目数不同，靠 auto 让「共 N 篇 / 进入」落在同一水平线 */
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-faint);
}

.hm-sys__more span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: var(--text-soft);
}

.hm-sys__more:hover span { color: var(--sys); }
.hm-sys__more .icon { width: 11px; height: 11px; }

/* ---------- 最近更新：两列清单 ---------- */
.hm-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 48px;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.hm-list a {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 12px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  transition: background 0.15s var(--ease);
}

.hm-list a:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.hm-list time {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
}

.hm-list__title {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.55;
}

.hm-list a:hover .hm-list__title { color: var(--brand); }

.hm-list__space {
  overflow: hidden;
  font-size: 11.5px;
  color: var(--text-faint);
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hm-empty {
  padding: 24px 0;
  font-size: 14px;
  color: var(--text-faint);
}

@media (max-width: 1240px) {
  .hm-sys { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
  /* 统计带窄屏换成 4 列 × 2 行，8 项刚好铺满，不会出现最后一行被拉宽 */
  .hm-tag__rows { flex-wrap: wrap; }
  .hm-tag__rows > div { flex: 1 1 22%; }
  .hm-tag__rows > div:nth-child(4n + 1) { border-left: 0; }
  .hm-tag__rows > div:nth-child(n + 5) { border-top: 1px solid var(--border); }
}

@media (max-width: 900px) {
  .hm-sys { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .hm-head { gap: 12px; }
  .hm-head h2 { font-size: 16px; }

  .hm-list { grid-template-columns: minmax(0, 1fr); column-gap: 0; }

  .hm-list a {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 2px 14px;
    padding: 12px 8px;
  }

  .hm-list__space {
    grid-column: 2;
    text-align: left;
  }

  /* 窄屏三格会挤成省略号，退回逐行更清楚 */
  .hm-tag__rows > div { flex: 1 1 46%; padding: 14px 10px 12px; }
  .hm-tag__rows > div:nth-child(n + 3) { border-top: 1px solid var(--border); }
  .hm-tag__rows > div:nth-child(odd) { border-left: 0; }
  .hm-tag dd { font-size: 22px; }

}

@media (max-width: 480px) {
  /* 窄屏一条标题已很密，篇数让位给可读性 */
  .hm-sys__list a .n { display: none; }
  .hm-search { padding-left: 12px; gap: 6px; }
  .hm-search__btn { padding: 0 14px; font-size: 13px; }
  .hm-hint a:first-of-type { margin-left: 0; }
}

/* 窄屏顶栏只留品牌名，避免按钮把栏宽撑爆 */
@media (max-width: 560px) {
  .brand-text span { display: none; }
  .header-inner { gap: 12px; }
}

/* 用户菜单：空间不足时先收起姓名，只留头像 + 箭头，绝不折行 */
@media (max-width: 720px) {
  .user-menu__name { display: none; }
  .user-menu__btn { gap: 4px; padding: 4px 7px 4px 4px; }
}

/* 导航项不换行；宽度不足时按档位收紧，保证导航、搜索、账户区都完整可见 */
.nav-link { white-space: nowrap; }

@media (max-width: 1500px) {
  .header-inner { gap: 18px; }
  .site-nav { gap: 2px; }
  .nav-link { padding: 7px 8px; font-size: 13px; letter-spacing: -0.01em; }
}

@media (max-width: 1360px) {
  .header-inner { gap: 16px; }
  .brand-text span { display: none; }
}

@media (max-width: 1400px) {
  .header-inner { gap: 14px; }
}

/* 平板横屏：品牌只留图标，导航再收紧一档 */
@media (max-width: 1160px) {
  .header-inner { gap: 10px; }
  .brand-text { display: none; }
  .nav-link { padding: 7px 6px; font-size: 12.5px; }
}

/* 导航收起后空间充裕，品牌名恢复显示 */
@media (max-width: 960px) {
  .brand-text { display: flex; }
}

@media (max-width: 1080px) {
  .header-inner { gap: 10px; }
}

/* ---------------- 文档详情：标题编号 / 标签行 / 元信息折叠 ---------------- */

/* 标题里的编号（TAL-PLA-04、S063…）收成浅灰小标识，正文标题一行读完 */
.doc-header h1.doc-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: clamp(26px, 2.7vw, 34px);
  line-height: 1.3;
  margin-bottom: 12px;
}

.doc-code {
  flex: none;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg-subtle);
  color: var(--text-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.45;
}

.doc-title__text { min-width: 0; }

/* 标签：只露一行，其余点「展开全部」 */
.doc-tags-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0 2px;
}

.doc-tags {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 26px;
  overflow: hidden;
}

.doc-tags.is-open { max-height: none; }

.doc-tags__toggle {
  flex: none;
  height: 24px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.doc-tags__toggle[hidden] { display: none; }

.doc-tags__toggle:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

/* 正文开头的元信息引用：先只显示一行，点开看全部 */
.doc-metaquote {
  margin: 18px 0 26px;
  padding-left: 14px;
  border-left: 2px solid var(--border);
  font-size: 13px;
  color: var(--text-faint);
}

.doc-metaquote > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}

.doc-metaquote > summary::-webkit-details-marker { display: none; }

.doc-metaquote__line {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.doc-metaquote__more {
  flex: none;
  padding: 1px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.doc-metaquote__more::after { content: ' ▾'; }

.doc-metaquote[open] .doc-metaquote__more::after { content: ' ▴'; }

.doc-metaquote:hover .doc-metaquote__more {
  border-color: var(--brand);
  color: var(--brand);
}

.doc-metaquote__body { margin-top: 10px; }

.prose .doc-metaquote__body blockquote {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------------- 文档反馈：点「需要改进」展开输入框 ---------------- */
.feedback-form {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}

.feedback-form[hidden] { display: none; }

.feedback-form__input {
  display: block;
  width: 100%;
  min-height: 88px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.feedback-form__input::placeholder { color: var(--text-faint); }

.feedback-form__input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.feedback-form__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.feedback-form__foot [data-feedback-count] { margin-right: auto; }

@media (max-width: 640px) {
  .feedback-form__foot { flex-wrap: wrap; }
}

/* ---------------- 搜索结果：编号收成尾部浅灰小字 ---------------- */
.result-code {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-faint);
}

/* =========================================================
   窄屏导航抽屉（960px 以下顶栏导航整条隐藏，靠这里进空间/工具）
   ========================================================= */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.mobile-drawer[hidden] { display: none; }

.mobile-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 14, 26, 0.45);
  animation: drawer-fade 0.18s var(--ease);
}

.mobile-drawer__panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(292px, 84vw);
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: drawer-slide 0.2s var(--ease);
}

@keyframes drawer-slide {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@keyframes drawer-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.mobile-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px 10px 14px;
  border-bottom: 1px solid var(--border);
}

.mobile-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px 24px;
}

.mobile-drawer__label {
  margin: 14px 8px 4px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* 抽屉里手指要好点：行高和内边距都比下拉菜单大一号 */
.mobile-drawer__body .nav-menu__item {
  gap: 10px;
  padding: 9px 8px;
}

.mobile-drawer__body .nav-menu__name { font-size: 14px; }

body.mobile-nav-open { overflow: hidden; }

/* 抽屉底部的账号入口：小屏顶栏放不下的注册 / 会员 / 退出都收在这里 */
.mobile-drawer__auth {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.mobile-drawer__auth form { margin: 0; }

.mobile-drawer__auth .btn { justify-content: center; gap: 7px; }

/* =========================================================
   手机自适应（≤720px / ≤430px）
   目标：320～430px 宽度下不出现横向滚动、不出现竖排文字、
   触控目标不小于 40px，长页可用抽屉与折叠降低滚动成本。
   ========================================================= */

/* ---------- 顶栏：先保「菜单 + 搜索 + 登录」，其余收紧 ---------- */
@media (max-width: 720px) {
  /* 顶栏高度沿用 --header-h：文档页/工具页的 sticky 偏移都按这个值算 */
  .header-inner { gap: 6px; }

  .header-actions { gap: 2px; }

  .header-actions .btn {
    height: 32px;
    padding: 0 10px;
    font-size: 13px;
  }

  .icon-btn,
  .search-pill {
    width: 34px;
    height: 34px;
  }

  .header-actions .user-menu__btn { padding: 3px; }
}

@media (max-width: 430px) {
  .header-inner { gap: 4px; }

  .brand { gap: 7px; }

  .brand-text strong { font-size: 14.5px; }

  .header-actions .btn {
    height: 30px;
    padding: 0 8px;
    font-size: 12.5px;
  }

  /* 320～380px 放不下两个按钮：注册进抽屉，登录页底部也有注册入口 */
  .header-register { display: none; }

  /* 首页导语第一句 25 个字，14.5px 差几像素会折出「整 / 理，」这种断字 */
  .hm-lede { font-size: 14px; }
}

/* ---------- 正文表格：手机上先按容器宽度排版，列多了再横向滑动 ---------- */
@media (max-width: 720px) {
  .table-wrap {
    margin: 14px 0;
    border-radius: 10px;
  }

  .table-wrap table {
    /* 手机上一律等宽分栏：自动布局会被长 URL 之类的单元格带偏，
       把「查什么」这种短表头挤成竖排 */
    table-layout: fixed;
    min-width: 100%;
    font-size: 13px;
  }

  /* 列数多（≥4 列）的表仍然保留原来的最小宽度，靠横向滑动看全 */
  .table-wrap.is-wide table { min-width: 520px; }

  .table-wrap th {
    white-space: normal;
    padding: 8px 10px;
    font-size: 12px;
  }

  .table-wrap td {
    padding: 9px 10px;
    /* 等宽栏位下长词/长链接必须能断，否则会顶破单元格 */
    word-break: break-word;
  }
}

/* ---------- 知识库总览：手机默认折叠，避免一页列出上千条 ---------- */
.overview-more {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
  padding: 10px;
  border: 1px dashed var(--border-strong);
  border-radius: 9px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
}

.overview-more:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }

@media (max-width: 860px) {
  .overview-card.is-collapsed .overview-body-inner {
    max-height: 460px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(180deg, #000 68%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 68%, transparent 100%);
  }

  .overview-card.is-collapsed .overview-more { display: flex; }
}

/* ---------- 页脚：手指点得着 ---------- */
@media (max-width: 720px) {
  .footer-col a,
  .footer-col span {
    padding: 5px 0;
    font-size: 13.5px;
  }

  .footer-brand p { font-size: 13px; }

  .site-footer { padding-bottom: 76px; } /* 给右下角 AI 圆球留位，别压住最后一行 */
}

/* ---------- 搜索页 ---------- */
@media (max-width: 720px) {
  .search-page { padding: 22px var(--pad-x) 96px; }
  .search-page h1 { font-size: 24px; }
  .search-hero-form .input { height: 44px; font-size: 15px; }
}

/* ---------- 胶囊标签：整颗一起换行，别把「纯水」拆成两行 ---------- */
.hm-hint a,
.search-hints .chip {
  display: inline-block;
  white-space: nowrap;
}

/* ---------- 表单与弹层：手机上能点、不触发 iOS 自动放大 ---------- */
@media (max-width: 720px) {
  /* iOS Safari 对字号 <16px 的输入框，聚焦时会强行放大整页 */
  .input,
  .textarea,
  .select,
  .search-dialog__input input,
  .ai-composer textarea {
    font-size: 16px;
  }

  .input,
  .select { min-height: 42px; }

  /* 搜索弹层贴顶，键盘弹起后结果区还能露出来 */
  .modal { padding: 8vh 12px 12px; align-items: flex-start; }

  .search-dialog {
    max-height: 78vh;
    border-radius: 14px;
  }

  .search-dialog__input { padding: 12px 14px; }

  /* 触屏上没有 ↑↓ / Enter / Esc，键盘提示纯属占地方 */
  .search-dialog__foot { display: none; }

  .search-results { min-height: 0; }
}

/* =========================================================
   设备图库：分类卡片 / 瀑布流图片墙 / 灯箱
   ---------------------------------------------------------
   分类卡片用于图库总览；图片墙用 CSS 多栏实现瀑布流，
   点击图片由 app.js 打开灯箱（大图 + 名称/分类/标签/来源/版权）。
   ========================================================= */

/* ---------- 图库总览：16 个分类卡片 ---------- */
.gal-index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: var(--s5);
  margin: var(--s6) 0 var(--s8);
}

.gal-index__card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.gal-index__card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.gal-index__thumbs {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 2px;
  height: 92px;
  background: var(--bg-sunken);
  overflow: hidden;
}

.gal-index__thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gal-index__ph {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  color: var(--text-faint);
}

.gal-index__body {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  padding: var(--s4) var(--s5) var(--s5);
}

.gal-index__head {
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.gal-index__head strong {
  font-size: 15px;
  color: var(--text);
}

.gal-index__seq {
  flex: none;
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 7px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 600;
}

.gal-index__count {
  margin-left: auto;
  flex: none;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.gal-index__count::after {
  content: " 张";
  color: var(--text-faint);
}

.gal-index__intro {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 图片墙 ---------- */
.gal-wrap { margin: var(--s6) 0 var(--s8); }

.gal-bar {
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: var(--s2) 0 var(--s4);
  border-bottom: 1px dashed var(--border);
  margin-bottom: var(--s5);
  font-size: 12.5px;
  color: var(--text-muted);
}

.gal-bar__count {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.gal-wall {
  columns: 230px;
  column-gap: var(--s4);
}

.gal-card {
  break-inside: avoid;
  margin: 0 0 var(--s4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.gal-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.gal-card__media {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--bg-sunken);
  line-height: 0;
  cursor: zoom-in;
}

.gal-card__media img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.35s ease;
}

.gal-card:hover .gal-card__media img { transform: scale(1.035); }

.gal-card__seq {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(9, 12, 20, 0.62);
  color: #fff;
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  backdrop-filter: blur(2px);
}

.gal-card__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px var(--s4) 12px;
}

.gal-card__title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  text-decoration: none;
}

.gal-card__title:hover { color: var(--brand); }

.gal-card__note {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gal-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.gal-tag {
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
}

.gal-tag:hover { color: var(--brand); border-color: var(--brand-ring); }

.gal-empty {
  padding: var(--s8);
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ---------- 详情页首图：整幅展示，可点开大图 ---------- */
.prose p > img:only-child {
  display: block;
  width: 100%;
  height: auto;
  margin: var(--s5) 0 var(--s6);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
}

/* ---------- 灯箱 ---------- */
.gal-lb {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  background: rgba(8, 11, 19, 0.88);
  backdrop-filter: blur(6px);
  animation: gal-lb-in 0.18s ease;
}

@keyframes gal-lb-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.gal-lb__stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 40px);
  min-height: 0;
  overflow: hidden;
}

.gal-lb__img {
  max-width: 100%;
  max-height: calc(100vh - 80px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7);
}

.gal-lb__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(15, 20, 32, 0.6);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}

.gal-lb__nav:hover { background: rgba(15, 20, 32, 0.9); }
.gal-lb__nav[disabled] { opacity: 0.28; cursor: default; }
.gal-lb__nav--prev { left: 14px; }
.gal-lb__nav--next { right: 14px; }

.gal-lb__panel {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  padding: var(--s6) var(--s6) var(--s7);
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  overflow-y: auto;
}

.gal-lb__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(15, 20, 32, 0.6);
  color: #fff;
  cursor: pointer;
  z-index: 2;
}

.gal-lb__head {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
}

.gal-lb__seq {
  flex: none;
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 600;
}

.gal-lb__title {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
  color: var(--text);
}

.gal-lb__sub {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.gal-lb__section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: var(--s4);
  border-top: 1px solid var(--border);
}

.gal-lb__label {
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  text-transform: uppercase;
}

.gal-lb__text {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-soft);
  word-break: break-word;
}

.gal-lb__source {
  font-size: 12.5px;
  color: var(--brand);
  word-break: break-all;
  text-decoration: none;
}

.gal-lb__source:hover { text-decoration: underline; }

.gal-lb__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gal-lb__actions {
  margin-top: auto;
  display: flex;
  gap: var(--s3);
  padding-top: var(--s5);
}

@media (max-width: 900px) {
  .gal-lb { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .gal-lb__panel { border-left: 0; border-top: 1px solid var(--border); max-height: 46vh; padding: var(--s5); }
  .gal-lb__img { max-height: calc(54vh - 24px); }
  .gal-lb__nav { width: 36px; height: 36px; }
}

@media (max-width: 720px) {
  .gal-wall { columns: 168px; column-gap: var(--s3); }
  .gal-card { margin-bottom: var(--s3); }
  .gal-card__body { padding: 8px 10px 10px; }
  .gal-card__note { display: none; }
  .gal-index { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s4); }
}

body.gal-lb-open { overflow: hidden; }

/* 灯箱内部元素自带 display，hidden 属性要显式生效 */
.gal-lb[hidden], .gal-lb [hidden] { display: none !important; }

/* 图片墙分页与蜜罐诱饵 */
.gal-more {
  display: flex;
  justify-content: center;
  padding: var(--s6) 0 var(--s4);
}

.gal-more .btn[disabled] { opacity: 0.6; cursor: progress; }

/* 屏幕外的诱饵链接：真人不会点，遍历脚本会跟进去 */
.gal-trap {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
