/* Google Fonts 引入，必须放最前面 */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Montserrat:wght@600&family=Fira+Code&display=swap');

/* 左上角搜索栏背景色 */
.wy-side-nav-search {
  background-color: #005bac !important; /* 飞凌主蓝 */
}

/* 搜索栏中版本号字体颜色 */
.wy-side-nav-search > div.version {
  color: white;
}

/* 侧边栏菜单项 hover 效果 */
.wy-menu-vertical a:hover {
  background-color: #e6f0ff !important;
  color: #005bac !important;
}

/* 扩展主内容区域宽度 */
.wy-nav-content {
  max-width: 1200px; /* 默认800px，可调1000~1400px */
}

/* 正文字体，主体区域和容器统一 */
body, .rst-content, .wy-nav-content {
  font-family: 'Lato', Arial, sans-serif !important;
  font-size: 16px;
  line-height: 1.7;
  color: #2c2c2c;
}

/* 标题字体 */
.rst-content h1,
.rst-content h2,
.rst-content h3,
.rst-content h4,
.rst-content h5,
.rst-content h6 {
  font-family: 'Montserrat', 'Lato', sans-serif !important;
  font-weight: 600;
  color: #1a1a1a;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  max-width: 100%;
  box-sizing: border-box;
}

/* 单独让 H2 标题变蓝色，覆盖上面的颜色 */
.rst-content h2 {
  color: #0071e3 !important;   /* 你想要的蓝色 */
}

/* 隐藏正文中的 toctree caption 标题（保留侧边栏） */
.rst-content .caption,
.rst-content .caption-text {
  display: none !important;
}

/* 代码字体 */
code, pre {
  font-family: 'Fira Code', 'JetBrains Mono', 'Source Code Pro', Consolas, Menlo, Monaco, 'Courier New', monospace !important;
  font-size: 14px;
  background-color: #f5f5f5;    /* 浅灰，适合阅读 */
  color: #333333;               /* 深灰色，替代刺眼的红色 */
  padding: 0.2em 0.4em;
  border-radius: 4px;
  line-height: 1.4;            /* 增加行高，提升阅读舒适度 */
  white-space: pre-wrap;       /* 支持自动换行 */
  word-break: break-word;      /* 防止单词过长撑破布局 */
  box-shadow: inset 0 0 5px rgba(0,0,0,0.05); /* 轻微内阴影，增加层次 */
}


/* 链接样式 */
a {
  color: #0071e3;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* 正文内页面目录（Table of Contents）字体 */
.rst-content .toctree-wrapper,
.rst-content .toctree-wrapper ul,
.rst-content .toctree-wrapper li,
.rst-content .toctree-wrapper a {
  font-family: 'Lato', Arial, sans-serif !important;
  font-size: 16px !important;             /* 字号适中 */
  color: #333333 !important;              /* 深灰，接近苹果正文主色 */
  line-height: 1.5 !important;
  text-decoration: none !important;
}

/* 一级目录（H1）链接加粗加大 */
.rst-content .toctree-wrapper > ul > li > a {
  font-weight: 700 !important;
  font-size: 18px !important;
}


/* 鼠标悬浮时链接颜色 */
.rst-content .toctree-wrapper a:hover {
  color: #0071e3 !important;     
}

/* 正文内页面目录标题 */
.rst-content .toctree-wrapper > p {
  font-family: 'Montserrat', 'Lato', sans-serif !important;
  font-weight: 600 !important;
  font-size: 24px !important;
  color: #0071e3 !important;             
  margin-bottom: 0.5em !important;
}

/* 禁止页面横向滚动（防止内容撑出屏幕） */
body {
  overflow-x: hidden;
}



@media (max-width: 768px) {
  .wy-nav-content {
    max-width: 100% !important;
    padding: 1em !important;
    box-sizing: border-box;
  }

  .rst-content .toctree-wrapper > p {
    font-size: 18px !important;
  }

  .rst-content .toctree-wrapper a {
    font-size: 14px !important;
  }

  pre {
    overflow-x: auto;       /* 超长代码可以左右滚动 */
    white-space: pre !important;  /* 保持原格式，不折行 */
    word-break: normal !important; /* 避免折行破坏代码 */
  }
  

  /* 新增：移动端正文、列表、表格、标题、链接换行 */
  .rst-content p,
  .rst-content li,
  .rst-content td,
  .rst-content a,
  .rst-content h1,
  .rst-content h2,
  .rst-content h3,
  .rst-content h4,
  .rst-content h5,
  .rst-content h6 {
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }


  .rst-content table-wrapper,
  .rst-content .md-table-wrapper {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
  }
  
  .rst-content table {
      width: auto;
      min-width: 600px;
      table-layout: auto;
  }
  
  .rst-content table td,
  .rst-content table th,
  .rst-content table td p,
  .rst-content table th p {
      white-space: normal !important;
      word-break: normal !important;
      padding: 4px 8px; /* 增加一点内边距更易阅读 */
      line-height: 1.4; /* 行距稍微放大，避免太挤 */
  }


  /* 移动端正文行高略微减小，提高紧凑感 */
  body, .rst-content, .wy-nav-content {
    line-height: 1.5;
  }  
}

/* 移动端极小屏字体微调（可选） */
@media (max-width: 480px) {
  body, .rst-content, .wy-nav-content {
    font-size: 15px;
  }
}

