/*
Theme Name: 帮助中心 Help Center
Description: 仿企业微信帮助中心。使用 WordPress 原生「文章 + 分类（支持二级）」，顶部显示系统菜单，分类卡片首页 + 左侧分类树 + 移动端适配 + 悬浮按钮。激活后自动生成示例。
Version: 1.17.3
Author: 土拉
*/

:root {
  --brand: #059669;          /* 品牌绿，与公众号一致（可由「主题设置」覆盖） */
  --brand-dark: #047857;
  --brand-soft: #ecfdf5;     /* 淡绿底（选中/当前项） */
  --brand-100: #d1fae5;      /* 卡片 hover 描边 */
  --brand-rgb: 5,150,105;    /* 品牌色 RGB，用于 rgba() 阴影等 */
  --text: #1d2129;          /* 主文字 */
  --text-2: #404656;        /* 正文 */
  --muted: #8a909c;         /* 次要文字 */
  --border: #eceef1;         /* 描边 */
  --divider: #f4f5f7;       /* 浅分隔线 */
  --bg: #f6f7f9;            /* 页面底色 */
  --card: #ffffff;
  --hover: #f5f6f8;         /* 菜单/列表 hover 底 */
  --hl-bg: #fff3bf;         /* 搜索高亮底 */
  --hl-text: #8a6d00;       /* 搜索高亮字 */
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.04);
  /* 文章页移动端左右内边距（后台可自定义，见「文章页移动端左右内边距」设置项）。
     直接影响双列步骤卡片每格的可用宽度：数值越小，窄屏上截图越大。 */
  --doc-pad-mobile: 18px;
  /* 文章页移动端「外层」左右内边距（卡片到屏幕边缘的距离），同样可自定义。
     与 --doc-pad-mobile 叠加生效：两端合计 = 屏幕到正文的距离。 */
  --doc-layout-pad-mobile: 16px;
  --shadow: 0 1px 3px rgba(16,24,40,.05), 0 6px 16px rgba(16,24,40,.04);
  --shadow-hover: 0 6px 14px rgba(16,24,40,.06), 0 18px 36px rgba(16,24,40,.07);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-2);
  background: var(--bg);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-decoration: none; transition: color .15s; -webkit-tap-highlight-color: transparent; }
a:hover { color: var(--brand-dark); }
/* 键盘聚焦用品牌绿描边，替代浏览器默认的蓝色焦点框 */
a:focus-visible, button:focus-visible, .nav-links .page-numbers:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
img { max-width: 100%; height: auto; }
::selection { background: var(--brand-soft); color: var(--brand-dark); }

/* ---------- 点击波纹动画：替代移动端默认的蓝色选中高亮 ---------- */
.hc-ripple {
  position: absolute; border-radius: 50%;
  background: rgba(var(--brand-rgb), .22);
  transform: scale(0); opacity: .55; pointer-events: none;
  animation: hc-ripple .55s cubic-bezier(.22,.61,.36,1) forwards;
}
@keyframes hc-ripple { to { transform: scale(2.6); opacity: 0; } }
/* 波纹宿主：建立相对定位并裁剪，使波纹只在元素内扩散 */
.cat-card, .hc-article-list li, .hc-nav a, .hc-tree a,
.nav-links .page-numbers, .hc-search button, .hc-copy-title { position: relative; overflow: hidden; }
/* 悬浮按钮本身已是 fixed（已定位），只需裁剪 */
.hc-fab, .hc-fab-top, .hc-fab-back { overflow: hidden; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.hc-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.hc-header-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 24px;
  height: 60px; display: flex; align-items: center; gap: 10px;
}
.hc-logo { display: inline-flex; align-items: center; gap: 9px; font-size: 18px; font-weight: 700; color: var(--text); white-space: nowrap; padding-right: 8px; }
.hc-logo:hover { color: var(--text); }
.hc-logo-mark { color: var(--brand); flex: none; }
.hc-nav-wrap { margin-left: auto; overflow: hidden; }
.hc-nav { list-style: none; display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; }
.hc-nav li { margin: 0; }
.hc-nav a {
  display: block; padding: 9px 15px; border-radius: 9px;
  color: var(--text); font-size: 15px; font-weight: 500; transition: background .15s, color .15s;
}
.hc-nav a:hover { background: var(--hover); color: var(--brand); }
.hc-nav .current-menu-item > a, .hc-nav li.active > a, .hc-nav li.current-cat > a { color: var(--brand-dark); font-weight: 600; background: var(--brand-soft); }

/* 移动端折叠按钮（默认隐藏） */
.hc-menu-toggle { display: none; }

/* ---------- Hero ---------- */
.hc-hero {
  background: radial-gradient(120% 120% at 50% -10%, #ffffff 0%, var(--bg) 72%);
  padding: 72px 0 56px; text-align: center;
}
.hc-hero h1 { margin: 0 0 10px; font-size: 32px; color: var(--text); font-weight: 800; letter-spacing: -.4px; }
.hc-hero-sub { margin: 0 0 30px; color: var(--muted); font-size: 15px; }
.hc-search { display: flex; align-items: center; background: #fff; border: 1.5px solid var(--border); border-radius: 999px; padding: 5px 6px 5px 20px; transition: border-color .2s, box-shadow .2s; }
.hc-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.hc-search input[type="search"] { border: none; background: transparent; outline: none; font-size: 16px; color: var(--text); }
.hc-search button { border: none; background: var(--brand); color: #fff; border-radius: 999px; padding: 10px 26px; cursor: pointer; font-size: 15px; font-weight: 600; transition: background .15s; }
.hc-search button:hover { background: var(--brand-dark); }
.hc-search-big { max-width: 600px; margin: 0 auto; box-shadow: var(--shadow); }
.hc-search-big input[type="search"] { width: 100%; flex: 1; }

/* ---------- 首页 / 分类页 分类卡片 ---------- */
.hc-home { padding: 34px 24px 72px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.cat-card {
  display: block; color: inherit; text-decoration: none;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow-sm); transition: box-shadow .25s, transform .25s, border-color .25s;
}
.cat-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); border-color: var(--brand-100); }
.cat-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cat-card-head h2 { margin: 0; font-size: 17px; font-weight: 700; color: var(--text); }
.cat-card:hover .cat-card-head h2 { color: var(--brand); }
.cat-more { font-size: 14px; color: var(--muted); white-space: nowrap; font-weight: 500; }
.cat-card:hover .cat-more { color: var(--brand); }
.cat-card-count { font-size: 14px; color: var(--muted); }
.cat-card-list { list-style: none; margin: 0; padding: 0; }
.cat-card-list li { padding: 11px 0; border-top: 1px solid var(--divider); }
.cat-card-list li:first-child { border-top: none; }
.cat-card-list a { color: var(--text-2); font-size: 15px; transition: color .15s, padding-left .15s; }
.cat-card-list a:hover { color: var(--brand); padding-left: 4px; }

/* ---------- 面包屑 ---------- */
.hc-breadcrumb { font-size: 13.5px; color: var(--muted); margin: 24px 0 16px; }
.hc-breadcrumb a { color: var(--muted); }
.hc-breadcrumb a:hover { color: var(--brand); }

/* ---------- 归档 / 搜索列表 ---------- */
.hc-archive { padding: 8px 24px 72px; }
.hc-archive-title { font-size: 24px; font-weight: 800; color: var(--text); margin: 0 0 18px; letter-spacing: -.3px; }
.hc-archive-desc { color: var(--muted); margin-bottom: 22px; font-size: 15px; }
.hc-article-list { list-style: none; margin: 0; padding: 0; }
.hc-article-list li {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 17px 22px; margin-bottom: 12px; transition: border-color .15s, box-shadow .15s;
}
.hc-article-list li:hover { border-color: var(--brand-100); box-shadow: var(--shadow); }
.hc-article-list li a { color: var(--text); font-size: 17px; font-weight: 600; }
.hc-article-list li a:hover { color: var(--brand); }
.hc-article-list li p { margin: 7px 0 0; color: var(--muted); font-size: 15px; line-height: 1.7; }

/* 搜索结果：文档归属类目（另起一行显示一级 / 二级） */
.hc-result-cat { margin: 8px 0 0; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; line-height: 1.6; }
.hc-result-cat-label { color: var(--muted); }
.hc-result-cat a { color: var(--brand); font-size: 13px; font-weight: 500; }
.hc-result-cat a:hover { text-decoration: underline; }
.hc-result-cat-sep { color: var(--border); }

/* 搜索关键字高亮 */
.hc-hl { background: var(--hl-bg); color: var(--hl-text); padding: 1px 4px; border-radius: 4px; font-weight: 600; }

/* ---------- 翻页（分类 / 搜索共用） ---------- */
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; justify-content: center; }
.nav-links .page-numbers {
  min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff;
  color: var(--text); font-size: 15px; font-weight: 500; transition: border-color .15s, color .15s, background .15s, box-shadow .15s;
}
.nav-links .page-numbers:hover { border-color: var(--brand); color: var(--brand); }
.nav-links .page-numbers.current { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 10px rgba(var(--brand-rgb), .28); }
.nav-links .page-numbers.dots { border: none; background: none; min-width: 22px; }

/* ---------- 文档页：左树 + 正文 ---------- */
.doc-layout { display: grid; grid-template-columns: 240px 1fr; gap: 30px; padding: 8px 24px 80px; align-items: start; }
.doc-sidebar {
  position: sticky; top: 80px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 14px; max-height: calc(100vh - 104px); overflow: auto;
}
.hc-tree, .hc-tree-sub { list-style: none; margin: 0; padding: 0; }
.hc-tree > li { margin-bottom: 3px; }
.hc-tree > li > a { display: block; padding: 9px 13px; border-radius: 9px; color: var(--text); font-weight: 600; font-size: 15px; }
.hc-tree > li.active > a, .hc-tree > li > a:hover { background: var(--brand-soft); color: var(--brand-dark); box-shadow: inset 3px 0 0 var(--brand); }
.hc-tree-sub { margin: 2px 0 8px 7px; border-left: 2px solid var(--divider); padding-left: 7px; }
.hc-tree-sub li a { display: block; padding: 7px 13px; border-radius: 9px; color: var(--muted); font-weight: 400; font-size: 14.5px; }
.hc-tree-sub li.active a, .hc-tree-sub li a:hover { color: var(--brand); background: var(--hover); }

.doc-main {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 36px 44px; min-width: 0; box-shadow: var(--shadow);
}
.doc-title {
  font-size: 26px; font-weight: 800; color: var(--text); margin: 2px 0 20px; padding-bottom: 18px;
  border-bottom: 1px solid var(--divider); cursor: pointer; user-select: none; transition: color .15s; letter-spacing: -.3px;
}
.doc-title:hover { color: var(--brand); }
.doc-content { max-width: 760px; font-size: 16px; color: var(--text-2); line-height: 1.85; }
.doc-content h2 { font-size: 20px; font-weight: 700; color: var(--text); margin: 32px 0 14px; }
.doc-content h3 { font-size: 17px; font-weight: 700; color: var(--text); margin: 26px 0 12px; }
.doc-content p { margin: 0 0 16px; }
.doc-content a { text-decoration: underline; text-underline-offset: 2px; }
.doc-content img { border-radius: 10px; margin: 16px 0; border: 1px solid var(--border); }
.doc-content ul, .doc-content ol { padding-left: 24px; margin: 0 0 16px; }
.doc-content li { margin: 5px 0; }
.doc-content blockquote { margin: 16px 0; padding: 12px 18px; background: var(--bg); border-left: 3px solid var(--brand); border-radius: 8px; color: var(--muted); }
.doc-content code { background: var(--bg); padding: 2px 7px; border-radius: 5px; font-size: 14px; color: var(--brand-dark); font-family: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; }
.hc-video { margin: 16px 0; }
.doc-content .wp-block-video, .doc-content .hc-video { margin: 16px 0; }
.doc-content video,
.doc-content .hc-video video,
.doc-content .wp-block-video video {
  display: block; max-width: 100%; max-height: 600px;
  width: auto; height: auto; border-radius: 10px; background: #000; margin: 16px 0;
}
/* 彻底覆盖 WordPress 默认视频框的固定宽度包裹 */
.doc-content .wp-video { width: 100% !important; max-width: 100% !important; height: auto !important; margin: 16px 0; }
.doc-content .wp-video video { max-width: 100% !important; }

/* 红色提示框（红色提示框区块 / [redbox] 短代码 / 经典编辑器直接插入） */
.hc-redbox {
  margin: 18px 0; padding: 14px 16px;
  background: #FBF1F0; border-left: 3px solid #E5484D; border-radius: 8px;
  color: #4a4a4a; font-size: 15px; line-height: 1.75;
}
.hc-redbox-content > :first-child { margin-top: 0; }
.hc-redbox-content > :last-child { margin-bottom: 0; }

/* ---------- 步骤卡片（编辑器工具栏插入，序号自动 1/2/3…） ---------- */
/* ⚠️ 结构要点（v1.13.1 起）：
   序号由「标题的 ::before」生成，**不要**再单独放一个空的 <span class="…__num"></span>。
   空的内联元素会被 TinyMCE 的内容清理直接删掉，一旦被删序号就没了；
   <figure> 同理不稳，一律改用 <div>。
   counter-reset 放在 .doc-content 上，即每篇文章从 1 重新开始编号。 */
.doc-content { counter-reset: hcstep; }
.hc-stepcard {
  counter-increment: hcstep;
  margin: 16px 0; padding: 12px 14px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-sm);
}
.hc-stepcard__title {
  margin: 0 !important; font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.5;
  /* ⚠️ 必须允许**词内断行**：一串连续数字（如 666666…）在默认规则下没有断行机会，
     会把卡片撑宽 → 连带把整个页面撑出横向滚动条（手机上表现为页面能左右滑）。
     overflow-wrap:anywhere 只在「放不下」时才断，不会影响正常中英文换行；
     前一行的 break-word 是给不支持 anywhere 的旧浏览器兜底。 */
  overflow-wrap: break-word;
  overflow-wrap: anywhere;
}
/* 序号圆标：直接生成在标题前面，随标题字号与卡片一起缩放 */
.hc-stepcard__title::before {
  content: counter(hcstep);
  display: inline-flex; align-items: center; justify-content: center;
  vertical-align: middle;
  width: 30px; height: 30px; margin-right: 9px;
  border-radius: 50%; background: var(--brand); color: #fff;
  font-size: 15px; font-weight: 700; line-height: 1;
}
.hc-stepcard__fig { margin: 10px 0 0; }
.hc-stepcard__fig:empty { display: none; }          /* 没插图片就不留空位（兼容旧内容） */
/* 图片样式挂在卡片上而非 __fig：用户在卡片任意位置插图都能正常显示 */
.hc-stepcard img { display: block; width: 100%; height: auto; border-radius: 6px; margin: 10px 0 0; }
.hc-stepcard__note {
  margin: 9px 0 0 !important; color: var(--muted); font-size: 14px; line-height: 1.7;
  overflow-wrap: break-word;   /* 同标题：长数字串也要能断行 */
  overflow-wrap: anywhere;
}
.hc-stepcard__note:empty { display: none; }         /* 说明文字留空就不显示 */

/* ---------- 双列步骤行（一张卡片 = 一个步骤，一行放两步） ----------
   用途：手机截图竖向很长，两张并排能省一半页面高度。
   实现：外层 .hc-stepcard-row 只是 flex 行容器，里面的卡片仍是标准 .hc-stepcard，
        所以**序号自动接着往下排**（第一行 1/2，第二行 3/4……），
        因为 counter-increment 认的是 .doc-content 的后代顺序，与包裹层无关。
   第三张及以后自动整行换行（独占一行），避免挤成三列。 */
.hc-stepcard-row {
  display: flex; align-items: flex-start; gap: 12px;
  margin: 16px 0;
}
.hc-stepcard-row > .hc-stepcard { flex: 1 1 0; min-width: 0; margin: 0; }
.hc-stepcard-row > .hc-stepcard:nth-child(n+3) { flex-basis: 100%; }

/* 窄屏也保持两列（这是「双列步骤」的意义所在），只把卡片内部尺寸收到极限又不失美观。
   用户要用单列时改插「步骤卡片」按钮即可（按钮本身就是按需选择，无需全局开关）。 */
@media (max-width: 640px) {
  /* ⚠️ 序号圆标与标题字号**刻意不缩小**，与单列步骤卡片保持一致 ——
     小屏上字太小反而更难读，这个取舍是用户明确要求的。
     这里只收卡片内边距与图片间距。 */
  .hc-stepcard-row { gap: 6px; margin: 10px 0; }
  .hc-stepcard-row > .hc-stepcard { padding: 8px 9px; border-radius: 8px; }
  .hc-stepcard-row .hc-stepcard__note { margin-top: 5px; }
  .hc-stepcard-row img { margin-top: 6px; }
}

/* ---------- 下载卡片 / 工具卡片（编辑器一键插入） ----------
   ⚠️ 图标一律用 ::before + CSS mask 绘制，**不把图标写进正文内容**：
      一是避免空元素被 TinyMCE 清理（见步骤卡片那三次返工），
      二是 mask 用 background-color 上色，图标能跟随「品牌主色」联动。
   ⚠️ 正文里有 .doc-content a { text-decoration:underline }（特异性更高），
      所以下面凡是 <a> 都必须用 .doc-content X 提升特异性来压制下划线。 */
.hc-dlcard { margin: 16px 0; }
.doc-content .hc-dlcard__link,
.hc-dlcard__link {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; text-decoration: none;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, background .15s, transform .15s;
}
.doc-content .hc-dlcard__link:hover,
.hc-dlcard__link:hover { border-color: var(--brand); background: var(--brand-soft); transform: translateY(-1px); }
.hc-dlcard__link::before {
  content: ''; flex: none; width: 40px; height: 40px; border-radius: 10px;
  background-color: var(--brand);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v11'/%3E%3Cpath d='m7.5 10.5 4.5 4.5 4.5-4.5'/%3E%3Cpath d='M4.5 20h15'/%3E%3C/svg%3E") no-repeat center / 22px 22px;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v11'/%3E%3Cpath d='m7.5 10.5 4.5 4.5 4.5-4.5'/%3E%3Cpath d='M4.5 20h15'/%3E%3C/svg%3E") no-repeat center / 22px 22px;
}
.hc-dlcard__body, .hc-toolkc__body { flex: 1; min-width: 0; }
.hc-dlcard__name, .hc-toolkc__name {
  display: block; font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.5;
  /* 同步骤标题：长数字串/长英文不允许把卡片撑破 */
  overflow-wrap: break-word;
  overflow-wrap: anywhere;
}
.hc-dlcard__desc, .hc-toolkc__desc {
  display: block; margin-top: 2px; font-size: 13.5px; color: var(--muted); line-height: 1.6;
  overflow-wrap: break-word;
  overflow-wrap: anywhere;
}
.hc-dlcard__desc:empty, .hc-toolkc__desc:empty { display: none; }
.hc-dlcard__cta {
  flex: none; font-size: 13.5px; font-weight: 600; color: var(--brand);
  padding: 6px 14px; border: 1px solid var(--brand); border-radius: 999px; white-space: nowrap;
  transition: background .15s, color .15s;
}
.hc-dlcard__link:hover .hc-dlcard__cta { background: var(--brand); color: #fff; }

.hc-toolkc {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0; padding: 14px 16px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-sm);
}
.hc-toolkc::before {
  content: ''; flex: none; width: 42px; height: 42px; border-radius: 11px;
  background-color: var(--brand);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='3.5' width='7' height='7' rx='1.6'/%3E%3Crect x='13.5' y='3.5' width='7' height='7' rx='1.6'/%3E%3Crect x='3.5' y='13.5' width='7' height='7' rx='1.6'/%3E%3Crect x='13.5' y='13.5' width='7' height='7' rx='1.6'/%3E%3C/svg%3E") no-repeat center / 23px 23px;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='3.5' width='7' height='7' rx='1.6'/%3E%3Crect x='13.5' y='3.5' width='7' height='7' rx='1.6'/%3E%3Crect x='3.5' y='13.5' width='7' height='7' rx='1.6'/%3E%3Crect x='13.5' y='13.5' width='7' height='7' rx='1.6'/%3E%3C/svg%3E") no-repeat center / 23px 23px;
}
.doc-content .hc-toolkc__cta,
.hc-toolkc__cta {
  flex: none; text-decoration: none; font-size: 13.5px; font-weight: 600;
  color: #fff; background: var(--brand); padding: 8px 16px; border-radius: 999px; white-space: nowrap;
  transition: background .15s;
}
.doc-content .hc-toolkc__cta:hover,
.hc-toolkc__cta:hover { background: var(--brand-dark); color: #fff; }

/* 窄屏：文字与按钮换行，避免长文件名把按钮挤出屏幕 */
@media (max-width: 560px) {
  .hc-dlcard__link, .hc-toolkc { flex-wrap: wrap; row-gap: 10px; }
  .hc-dlcard__cta, .doc-content .hc-toolkc__cta { margin-left: 52px; }
}

/* ---------- 侧边目录开关（移动端已隐藏） ---------- */
.hc-sidebar-toggle { display: none; }

/* ---------- 悬浮按钮（返回顶部 / 返回上一页） ---------- */
.hc-fab {
  position: fixed; right: 24px; z-index: 60;
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--border);
  background: #fff; color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); transition: color .15s, border-color .15s, box-shadow .15s, transform .15s;
}
.hc-fab:hover { color: var(--brand); border-color: var(--brand); box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.hc-fab-top { bottom: 24px; }
.hc-fab-back { bottom: 78px; }

/* ---------- 复制提示 toast ---------- */
.hc-toast {
  position: fixed; left: 50%; bottom: 38px; transform: translateX(-50%) translateY(10px);
  background: rgba(29,33,41,.94); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: 14px; z-index: 80; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.hc-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 图片放大（lightbox） ---------- */
.hc-lightbox {
  position: fixed; inset: 0; z-index: 90; display: none;
  align-items: center; justify-content: center; padding: 24px;
  /* 背景已用 86% 不透明度的深色，足够压暗背景。
     这里刻意**不加 backdrop-filter**——它在移动端 GPU 上会连累整棵子树的渲染质量，
     表现为「灯箱里的图片发糊」，属于典型的移动端合成层渲染问题。 */
  background: rgba(17,20,24,.86);
  touch-action: none; overscroll-behavior: none;
}
.hc-lightbox.open { display: flex; }
.hc-lightbox img {
  max-width: 92vw; max-height: 88vh; border-radius: 10px; box-shadow: 0 16px 48px rgba(0,0,0,.5);
  touch-action: none; cursor: zoom-in; transform-origin: center center;
  user-select: none; -webkit-user-select: none;
  transition: opacity .25s ease;
}
/* 只在「正在缩放/拖动」的 200ms 内提层（拖动要顺滑）；
   手指一停就撤掉，浏览器立刻按最终倍率重新光栅化 —— 手机上放大才不会糊。
   ⚠️ 常驻 will-change:transform 会让图层只按初始倍率栅格化，缩放后永远模糊。 */
.hc-lightbox img.is-zooming { will-change: transform; }
/* 灯箱加载动画（点击图片查看原图时，加载完成前显示转圈） */
.hc-lightbox-spinner {
  position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%;
  display: none; z-index: 2; animation: hc-spin .8s linear infinite;
}
.hc-lightbox.loading .hc-lightbox-spinner { display: block; }
.hc-lightbox.zoomed img { cursor: grab; }
.hc-lightbox.zoomed img:active { cursor: grabbing; }
.hc-lightbox-close {
  position: absolute; top: 18px; right: 22px; width: 40px; height: 40px;
  border: none; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer; transition: background .15s;
  z-index: 6;   /* 保证关闭按钮始终在最前：不被放大的图片（含 scale 后铺满全屏）遮挡 */
}
.hc-lightbox-close:hover { background: rgba(255,255,255,.3); }

/* ---------- 企业微信「发送给客户」按钮（仅企微聊天工具栏入口渲染） ---------- */
.hc-wecom-send { margin: 0 0 24px; }
.hc-wecom-send--bottom {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 70; margin: 0;
}
.hc-wecom-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 24px; border: none; border-radius: 999px;
  background: var(--hc-btn-color, var(--brand)); color: #fff;
  /* 字号走变量：尺寸档位 class 给 --hc-btn-font，后台自定义的行内变量优先级更高 */
  font-size: var(--hc-btn-font, 15px);
  font-weight: 600; font-family: inherit; line-height: 1.4; cursor: pointer;
  box-shadow: 0 6px 18px rgba(var(--hc-btn-rgb, var(--brand-rgb)), .3);
  transition: background .15s, transform .15s, opacity .15s, box-shadow .15s;
}
.hc-wecom-btn:hover { background: var(--hc-btn-hover, var(--brand-dark)); transform: translateY(-1px); }
.hc-wecom-btn:active { transform: translateY(0) scale(.97); }
.hc-wecom-btn:disabled { opacity: .75; cursor: default; transform: none; }

/* 按钮尺寸档位（后台「按钮大小」可调；这里只管内边距与默认字号） */
.hc-wecom-btn--sm { padding: 8px 18px; gap: 6px; --hc-btn-font: 14px; }
.hc-wecom-btn--md { padding: 11px 24px; --hc-btn-font: 15px; }
.hc-wecom-btn--lg { padding: 15px 32px; gap: 9px; --hc-btn-font: 17px; }

/* 图标 / 发送中转圈：尺寸跟随按钮字号等比缩放。
   用 em 而非固定 px —— 后台自定义字号（如 24px）时图标自动跟着放大，
   不需要再为每个档位写死一套 svg 宽高。
   （CSS 规则会覆盖 <svg> 元素上的 width/height 表现属性，JS 里的 16 只是兜底。） */
.hc-wecom-btn__ico { display: inline-flex; align-items: center; }
.hc-wecom-btn__ico svg { width: 1.05em; height: 1.05em; }
.hc-wecom-btn__spin { display: none; width: 1em; height: 1em; }
.hc-wecom-btn.loading .hc-wecom-btn__ico { display: none; }
.hc-wecom-btn.loading .hc-wecom-btn__spin {
  display: block;
  border: .14em solid rgba(255,255,255,.35); border-top-color: #fff;
  border-radius: 50%; animation: hc-spin .7s linear infinite;
}

/* 呼吸动画（忽大忽小）。注意 animation 会覆盖 transform，
   所以 hover / active 时暂停动画，让上浮与按压效果仍然生效。 */
@keyframes hc-wecom-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.07); }
}
.hc-wecom-btn--pulse { animation: hc-wecom-breathe 1.9s ease-in-out infinite; }
/* 用 animation:none 而不是 paused —— paused 会把按钮冻结在某个中间尺寸，
   看起来像卡住；直接关掉动画才能让 hover 上浮 / active 按压的 transform 正常生效。 */
.hc-wecom-btn--pulse:hover,
.hc-wecom-btn--pulse:active,
.hc-wecom-btn--pulse.loading { animation: none; }
.hc-wecom-btn--pulse.loading { opacity: .75; }

@media (prefers-reduced-motion: reduce) {
  .hc-wecom-btn--pulse { animation: none; }
}

.hc-wecom-toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%) translateY(8px);
  background: rgba(29,33,41,.94); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: 14px; z-index: 95; opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s; box-shadow: 0 8px 24px rgba(0,0,0,.2);
  max-width: 86vw; text-align: center;
}
.hc-wecom-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.hc-wecom-toast.err { background: rgba(191,32,32,.95); }

/* ---------- 自动加载更多（无限滚动） ---------- */
.hc-infinite { min-height: 1px; }
.hc-infinite.hc-loading::before {
  content: ""; display: block; width: 22px; height: 22px; margin: 26px auto;
  border: 2px solid var(--border); border-top-color: var(--brand); border-radius: 50%;
  animation: hc-spin .7s linear infinite;
}
@keyframes hc-spin { to { transform: rotate(360deg); } }
.hc-infinite-done { display: block; text-align: center; color: var(--muted); font-size: 14px; margin: 24px 0 8px; }

/* ---------- Footer ---------- */
.hc-footer { background: #fff; border-top: 1px solid var(--border); padding: 28px 24px; }
.hc-footer-inner { max-width: 1120px; margin: 0 auto; display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }
  .hc-header-inner { height: auto; padding: 10px 16px; flex-wrap: wrap; }
  .hc-logo { flex: 1; font-size: 18px; gap: 8px; }

  /* 顶部菜单折叠为汉堡按钮 */
  .hc-menu-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 4px;
    width: 42px; height: 42px; padding: 10px; margin-left: 8px;
    border: 1px solid var(--border); background: #fff; border-radius: 10px; cursor: pointer;
  }
  .hc-menu-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }
  .hc-nav-wrap { display: none; width: 100%; overflow: visible; margin-left: 0; }
  .hc-header.hc-nav-open .hc-nav-wrap { display: block; }
  .hc-nav { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 0; }
  .hc-nav li a { padding: 14px 14px; border-radius: 0; border-top: 1px solid var(--border); font-size: 15px; }
  .hc-nav li:first-child a { border-top: none; }

  .hc-hero { padding: 46px 0 38px; }
  .hc-hero h1 { font-size: 26px; }
  .hc-hero-sub { font-size: 15px; margin-bottom: 26px; }
  .hc-search-big { margin: 0 16px; }
  .hc-search { padding: 6px 6px 6px 18px; }
  .hc-search input[type="search"] { font-size: 16px; }
  .hc-search button { font-size: 15px; padding: 11px 22px; }
  .hc-home { padding: 26px 16px 56px; }

  .doc-layout { grid-template-columns: 1fr; gap: 14px; padding: 8px var(--doc-layout-pad-mobile) 56px; }
  /* 移动端隐藏文章内目录（左侧树 + 开关均不显示） */
  .doc-sidebar, .hc-sidebar-toggle { display: none !important; }
  .doc-main { padding: 24px var(--doc-pad-mobile); }
  .doc-title { font-size: 22px; }
  .doc-content { font-size: 16px; line-height: 1.8; }

  .cat-grid { grid-template-columns: 1fr; gap: 14px; }
  .cat-card { padding: 18px 18px; }
  .cat-card-head { margin-bottom: 8px; }
  .cat-card-head h2 { font-size: 17px; }
  .cat-card-list a { font-size: 15px; }
  .cat-card-list li { padding: 12px 0; }

  .hc-archive { padding: 8px 16px 56px; }
  .hc-archive-title { font-size: 22px; }
  .hc-article-list li { padding: 15px 16px; }
  .hc-article-list li a { font-size: 17px; }
  .hc-article-list li p { font-size: 15px; }
  .hc-result-cat, .hc-result-cat a { font-size: 13px; }
  .hc-breadcrumb { font-size: 14px; margin: 18px 0 14px; }

  .nav-links { gap: 7px; margin-top: 24px; }
  .nav-links .page-numbers { min-width: 42px; height: 42px; font-size: 15px; }

  .hc-fab { right: 14px; width: 46px; height: 46px; }
  .hc-fab-top { bottom: 16px; }
  .hc-fab-back { bottom: 70px; }
  .hc-footer-inner { font-size: 13px; flex-direction: column; gap: 4px; text-align: center; }
}
