@charset "utf-8";
/* =====================================================
   Forlinx Product Manual Design System
   Web First 路径 · PDF Fallback
   ===================================================== */


/* =====================================================
   1. 全局基础（Web 优先）
   ===================================================== */

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
	scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background: #ffffff;
  color: #1d1d1f;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Text",
    "Helvetica Neue",
    Arial,
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  line-height: 1.65;
}


/* =====================================================
   2. 页面整体布局（三栏）
   ===================================================== */

.page-layout {
  display: grid;
  grid-template-columns: 260px minmax(400px, 1fr) 300px;
  min-height: 100vh;
  width: 100%;
}


/* =====================================================
   3. 左侧目录栏（TOC）
   ===================================================== */

/* ===== Sidebar Brand / Logo ===== */
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0 18px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e5e5e5;
}

.sidebar-brand img {
  width: clamp(160px, 18vw, 220px);
  height: auto;
}



/* PC 端左侧目录栏固定 */
.sidebar {
  background: #f7f7f7;
  border-right: 1px solid #e5e5e5;
  padding: 24px 20px;
  overflow-y: auto;
  position: sticky;  /* 保持可见 */
  top: 24px;         /* 距离页面顶部距离，可根据需要调整 */
  max-height: calc(100vh - 48px); /* 高度随视口变化 */
}

/* 目录样式 */
.toc a {
  display: block;
  font-size: 14px;
  color: #333;
  text-decoration: none;
  padding: 6px 0;
  transition: color 0.2s;
}

.toc a.h2 { font-weight: 600; }
.toc a.h3 { padding-left: 14px; font-size: 13px; }
.toc a.h4 { padding-left: 28px; font-size: 12.5px; color: #666; }

.toc a:hover,
.toc a.active {
  color: #007aff;  /* 当前章节高亮 */
}

.toc-toggle, .sidebar-mobile { display: none;}


/* =====================================================
   4. 中间正文（核心阅读区域）
   ===================================================== */

.main-content {
  padding: 48px 72px;
  max-width: none;
}

.main-content h1,
.main-content h2,
.main-content h3,
.main-content h4 {
  color: #111;
  font-weight: 600;
  scroll-margin-top: 80px;
}

.main-content h1 {
  font-size: 40px;
  margin-bottom: 1.2rem;
  border-bottom: 2px solid #e5e5e5;
  padding-bottom: 0.5rem;
}

.main-content h2 {
  font-size: 35px;
  margin-top: 3rem;
}

.main-content h3 {
  font-size: 28px;
  margin-top: 2rem;
}

.main-content h4 {
  font-size: 22px;
  margin-top: 1.5rem;
}

.main-content p {
  margin: 0.5rem 0 0.8rem;
  font-size: 1rem;
}


/* =====================================================
   5. Forlinx 技术手册全局表格升级版
   ===================================================== */

/* ===== 限制 image-table 和 param-table 表格宽度 ===== */
figure.image-table,
figure.param-table {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  margin: 1.5rem 0;
  box-sizing: border-box;
}

figure.image-table table,
figure.param-table table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

/* 保持 table 样式 */
figure.image-table table th,
figure.param-table table th {
  text-align: left;
  font-weight: 600;
  background: linear-gradient(180deg, #f5f5f7, #eaeaea);
  border-bottom: 2px solid #d2d2d7;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 2;
}

figure.image-table table td,
figure.param-table table td {
  padding: 12px 16px;
  vertical-align: top;
  border-bottom: 1px solid #e5e5e5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 隔行底色和悬浮高亮 */
figure.image-table table tbody tr:nth-child(even),
figure.param-table table tbody tr:nth-child(even) {
  background-color: #fafafa;
}


/* =====================================================
   6. 图片 / Image Table
   ===================================================== */

img {
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
}

.image-table img {
  border-radius: 8px;
  border: 1px solid #eee;
}

.main-content img {
  cursor: zoom-in;
}

.main-content img.zoomed {
  position: fixed;
  top: 50%;
  left: 50%;
  max-width: 90vw !important;
  max-height: 90vh !important;
  width: auto;
  height: auto;
  margin: 0;
  object-fit: contain;
  transform: translate(-50%, -50%);
  z-index: 9999;
  cursor: zoom-out;
  background: #fff;
  transition: all 0.25s ease;
  user-select: none;
}


/* ========== Logo 图片组 ========== */
.logo-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin: 15pt 0;
}

.logo-group img {
  max-height: 40px;
  height: auto;
}

/* PDF fallback */
@media print {
  .logo-group {
    display: block !important;
  }
  .logo-group img {
    display: inline-block;
    margin: 5pt 0;
  }
}


/* =====================================================
   7. 按钮 / 操作区
   ===================================================== */

.button-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.button {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid #007aff;
  color: #007aff;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.button.primary {
  background: #007aff;
  color: #fff;
}

.button:hover {
  background: #007aff;
  color: #fff;
}


/* =====================================================
   8. 右侧工具区 / 在线客服
   ===================================================== */
/* ================= Right Sticky Side Panel ================= */

.search-panel {
  position: sticky;
  top: 24px;
  align-self: flex-start;

  background: #fafafa;
  border-left: 1px solid #e5e5e5;
  padding: 20px;
  border-radius: 12px;

  /* 核心：限制高度 + 内部滚动 */
  max-height: calc(100vh - 48px);
  overflow-y: auto;

  /* 细节优化 */
  box-sizing: border-box;
}

/* ================= Panel Title ================= */

.search-panel h3 {
  font-size: 14pt;
  margin: 0 0 12px 0;
  font-weight: 600;
}

/* ================= Support Box ================= */

.support-box {
  margin-bottom: 20px;
  padding: 14px;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
}

/* ================= Support Buttons ================= */

.support-btn {
  display: block;
  text-align: center;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #d2d2d7;
  color: #1d1d1f;
  text-decoration: none;
  font-size: 10.5pt;
  line-height: 1.4;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.support-btn:hover {
  background: #f2f6ff;
}

/* 主按钮（Alibaba / Buy） */
.support-btn.primary {
  background: #0071e3;
  color: #ffffff;
  border-color: #0071e3;
}

.support-btn.primary:hover {
  background: #005bb5;
}

/* ================= Scrollbar (Webkit, optional) ================= */

.search-panel::-webkit-scrollbar {
  width: 6px;
}

.search-panel::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.18);
  border-radius: 4px;
}

.search-panel::-webkit-scrollbar-track {
  background: transparent;
}


/* =====================================================
   9. 移动端
   ===================================================== */

/* =====================================================
   9. 移动端（优化路径 · 文档阅读优先）
   ===================================================== */
@media (max-width: 1024px) {
  /* 隐藏桌面端 sidebar */
  .sidebar:not(.sidebar-mobile) {
    display: none;
  }

  /* 显示移动端抽屉 sidebar */
  .sidebar-mobile {
    display: block;
  }
}

.sidebar-overlay {
  display: none; 
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.4); 
  z-index: 998; /* 确保在侧边栏 999 之下 */
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
  display: block; /* 显示遮罩 */
}

@media (max-width: 1024px) {
  .sidebar-brand {
    padding: 4px 0 10px;
    margin-bottom: 8px;
  }

  .sidebar-brand img {
    max-width: 120px;
    max-height: 32px;
  }
}


@media (max-width: 1024px) {

  /* ===== 页面布局单栏 ===== */
  .page-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  /* ===== 顶部目录 ===== */
  .sidebar {
    position: relative;
    display: block;
    width: 100%;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid #e5e5e5;
    background: #fafafa;
    padding: 12px 14px;
    overflow-x: auto;
  }

  .sidebar::before {
    content: "📖 Contents";
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: #111;
  }

  .toc {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px 16px;
  }

  .toc a {
    font-size: 13px;
    padding: 4px 0;
    color: #007aff;
    white-space: nowrap;
  }

  .toc a.h3,
  .toc a.h4 {
    padding-left: 0;
    font-weight: 400;
  }

  /* ===== 主内容 ===== */
  .main-content {
    padding: 16px 12px 28px;
  }

  .main-content h1 {
    font-size: 1.6rem;
  }

  .main-content h2 {
    font-size: 1.3rem;
  }

  .main-content h3 {
    font-size: 1.15rem;
  }

  .main-content h4 {
    font-size: 1.05rem;
  }

  /* 新增：优化移动端正文字号（15px 黄金比例） */
  .main-content p {
    font-size: 0.9375rem;
    line-height: 1.6;
  }
	
  /* 同步列表与正文的字号 */
  .main-content ul,
  .main-content ol {
    font-size: 0.9375rem; /* 与 p 完全一致 ≈15px */
    line-height: 1.6;
  }
	
  /* ===== Logo 组居中显示 ===== */
  .logo-group {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 4px;
    margin: 8px 0;
  }

  .logo-group img {
    max-height: 30px;
    height: auto;
    margin: 0 6px;
  }

  /* ===== 产品图片支持点击放大 ===== */
  .main-content img:not(.logo-group img) {
    max-width: 100%;
    height: auto;
    cursor: zoom-in;
    transition: transform 0.3s ease;
  }

  .main-content img.zoomed {
    position: fixed;
    top: 50%;
    left: 50%;
    max-width: 90%;
    max-height: 90%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    cursor: zoom-out;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  }


  /* ===== 表格：移动端宽度与字号优化 ===== */
  figure.image-table,
  figure.param-table {
    overflow-x: auto;
  }

  /* 新增：移动端降低表格字号 */
  figure.image-table table,
  figure.param-table table {
    font-size: 0.875rem;
  }

  figure.image-table table th,
  figure.param-table table th,
  figure.image-table table td,
  figure.param-table table td {
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: break-word;
    padding: 8px 10px;
  }
	
  /* ===== 移动端目录抽屉按钮 ===== */
  .toc-toggle {
    display: block;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1000;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: #007aff;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
  }

  .sidebar-mobile {
    position: fixed;
    top: 0;
    left: -260px;
    width: 260px;
    height: 100%;
    background: #f7f7f7;
    border-right: 1px solid #e5e5e5;
    overflow-y: auto;
    padding: 20px;
    transition: left 0.3s ease;
    z-index: 999;
  }

  .sidebar-mobile.open {
    left: 0;
  }

  .toc-mobile a {
    display: block;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    padding: 6px 0;
  }

  .toc-mobile a.h2 {
    font-weight: 600;
  }

  .toc-mobile a.h3 {
    padding-left: 14px;
    font-size: 13px;
  }

  .toc-mobile a.h4 {
    padding-left: 28px;
    font-size: 12.5px;
    color: #666;
  }

  .toc-mobile a:hover {
    color: #007aff;
  }

  /* ===== 操作按钮：全宽卡片化 ===== */
  .button-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 20px 0;
  }

  .button {
    width: 100%;
    text-align: center;
    padding: 12px 0;
    font-size: 15px;
    border-radius: 14px;
  }

  /* ===== 右侧栏：下沉信息区 ===== */
  .search-panel {
    position: relative;

    top: auto;
    border-left: none;
    border-top: 1px solid #e5e5e5;
    border-radius: 0;
    margin-top: 24px;
    padding: 16px 12px;
    background: #f9f9f9;
  }
}


/* =====================================================
   10. PDF / Print（降级输出）
   ===================================================== */

@media print {
  @page {
    size: A4;
    margin: 20mm;
  }

  body {
    font-size: 11pt;
  }

  .sidebar,
  .search-panel,
  .button-group {
    display: none !important;
  }

  .main-content {
    padding: 0;
  }

  h1 {
    font-size: 20pt;
  }

  h2 {
    font-size: 15pt;
  }
}
