/* =========================================================

   Robot Documentation Center - Custom Theme

   ========================================================= */



/* ---------- 全局 ---------- */



:root {
  --robot-primary: #08245c;
  --robot-primary-hover: #103b82;
  --robot-sidebar-bg: #f3f6fa;
  --robot-border: #d9e0ea;
  --robot-text: #202936;
  --robot-muted: #667085;

  /* 首页机器人品牌 Logo 的统一显示高度 */
  --robot-brand-logo-height: 38px;
}



body {

  color: var(--robot-text);

}



/* ---------- 顶部导航 ---------- */



.navbar {

  background: var(--robot-primary);

  min-height: 3.4rem;

}



.navbar-brand {

  padding-left: 1.25rem;

}



.navbar-brand .navbar-item:first-child {

  font-size: 1.25rem;

  font-weight: 700;

  letter-spacing: 0.02em;

}



.navbar-end > .navbar-item {

  font-weight: 600;

  padding-left: 1rem;

  padding-right: 1rem;

}



.navbar-end > a.navbar-item:hover {

  background: var(--robot-primary-hover);

}



/* ---------- 搜索框 ---------- */



.navbar-brand .navbar-item.search {

  justify-content: center;

  padding-left: 2rem;

}



\#search-input {

  width: 260px;

  height: 2rem;

  padding: 0 0.75rem;

  border: 1px solid rgba(255, 255, 255, 0.45);

  border-radius: 4px;

  background: #fff;

  font-size: 0.9rem;

}



\#search-input:focus {

  border-color: #8fb7ff;

  box-shadow: 0 0 0 2px rgba(143, 183, 255, 0.2);

}



/* ---------- 左侧导航 ---------- */



.nav {

  background: var(--robot-sidebar-bg);

  border-right: 1px solid var(--robot-border);

}



.nav-menu {

  padding: 0.9rem 0.85rem;

}



.nav-menu h3.title {

  color: #1d2939;

  font-weight: 700;

}



.nav-item {

  margin-top: 0.35rem;

}



.nav-link {

  border-radius: 4px;

  padding: 0.22rem 0.4rem;

}



.nav-link:hover {

  background: #e8eef7;

  color: var(--robot-primary);

}



.is-current-page > .nav-link {

  color: var(--robot-primary);

  background: #dfe9f8;

  font-weight: 700;

}



/* ---------- 左下角版本区域 ---------- */



.nav-panel-explore .context {

  background: #fff;

  border-top: 1px solid var(--robot-border);

}



.nav-panel-explore .components {

  background: #fff;

}



.nav-panel-explore .component .version a {

  background: #e8edf4;

}



.nav-panel-explore .component .is-current a {

  background: var(--robot-primary);

  color: #fff;

}



/* ---------- 正文区域 ---------- */



.doc {

  max-width: 980px;

  padding-left: 2rem;

  padding-right: 2rem;

}



.doc h1 {

  font-size: 2rem;

  margin-bottom: 1.25rem;

}



.doc h2 {

  border-bottom: 1px solid var(--robot-border);

  padding-bottom: 0.4rem;

  margin-top: 2rem;

}



.doc h3 {

  margin-top: 1.4rem;

}



.doc p,

.doc li {

  line-height: 1.75;

}



/* ---------- 链接 ---------- */



.doc a {

  color: #1769c2;

}



.doc a:hover {

  color: #0c4c95;

}



/* ---------- 右侧 Contents ---------- */



.toc.sidebar {

  border-left: 1px solid var(--robot-border);

}



.toc.sidebar .toc-menu {

  font-size: 0.85rem;

}



/* ---------- 小屏适配 ---------- */



@media screen and (max-width: 1023.5px) {

  #search-input {

    width: 200px;

  }



  .doc {

    padding-left: 1rem;

    padding-right: 1rem;

  }

}



/* =========================================================

   Portal Home

   ========================================================= */



.portal-intro {

  margin-bottom: 2rem;

  font-size: 1rem;

  color: var(--robot-muted);

}



/* 卡片区域 */

.robot-card-section > .sectionbody {

  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 1.25rem;

  margin-top: 1.25rem;

  margin-bottom: 2.5rem;

}



/* 单个入口卡片 */

.robot-card {

  position: relative;

  min-height: 190px;

  padding: 1.35rem 1.45rem;

  border: 1px solid var(--robot-border);

  border-radius: 8px;

  background: #fff;

  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);

  transition:

    transform 0.18s ease,

    box-shadow 0.18s ease,

    border-color 0.18s ease;

}



/* 鼠标经过 */

.robot-card:hover {

  transform: translateY(-2px);

  border-color: #9ab7df;

  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.10);

}



/* 卡片标题 */

.doc .robot-card h3 {

  margin-top: 0;

  margin-bottom: 0.75rem;

  font-size: 1.25rem;

  color: #102a56;

}



/* 卡片文字 */

.robot-card p {

  margin-top: 0.45rem;

  margin-bottom: 0.65rem;

  color: #475467;

}



/* 卡片入口链接 */

.robot-card p:last-child a {

  display: inline-block;

  margin-top: 0.65rem;

  font-weight: 700;

  color: #1769c2;

  text-decoration: none;

}



.robot-card p:last-child a:hover {

  color: #0c4c95;

  text-decoration: underline;

}



/* 首页区块标题 */

.doc .robot-card-section > h2 {

  margin-top: 2.2rem;

  color: #162b4d;

}



/* 平板和手机改成单列 */

@media screen and (max-width: 768px) {

  .robot-card-section > .sectionbody {

    grid-template-columns: 1fr;

  }



  .robot-card {

    min-height: auto;

  }

}



/* =========================================================

   Portal Home - 首页专用布局

   ========================================================= */



/* 首页隐藏左侧文档导航 */

body.portal-home .nav-container {

  display: none;

}



/* 首页主体不再为左侧导航预留空间 */

body.portal-home .body {

  margin-left: 0;

}



/* 首页正文整体变宽 */

body.portal-home .article {

  max-width: 1280px;

  margin-left: auto;

  margin-right: auto;

}



/* 首页正文内容进一步放宽 */

body.portal-home .doc {

  max-width: 1180px;

  margin-left: auto;

  margin-right: auto;

  padding-left: 3rem;

  padding-right: 3rem;

}



/* 首页标题居中一些 */

body.portal-home .doc > h1.page {

  text-align: center;

  margin-top: 2rem;

  font-size: 2.4rem;

}



/* 首页介绍文字 */

body.portal-home .portal-intro {

  max-width: 760px;

  margin-left: auto;

  margin-right: auto;

  margin-bottom: 2.5rem;

  text-align: center;

}



/* 首页品牌卡片区域最多利用更宽空间 */

body.portal-home .robot-card-section > .sectionbody {

  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));

  gap: 1.25rem;

}



/* 首页卡片尺寸稍大 */

body.portal-home .robot-card {

  min-height: 220px;

  display: flex;

  flex-direction: column;

}



body.portal-home .robot-card p:last-child {

  margin-top: auto;

}



/* 首页隐藏顶部工具栏中不必要的留白 */

body.portal-home .toolbar {

  max-width: 1180px;

  margin-left: auto;

  margin-right: auto;

}



/* 小屏恢复正常 */

@media screen and (max-width: 1023.5px) {

  body.portal-home .doc {

    padding-left: 1.25rem;

    padding-right: 1.25rem;

  }

}



@media screen and (max-width: 768px) {

  body.portal-home .robot-card-section > .sectionbody {

    grid-template-columns: 1fr;

  }



  body.portal-home .doc > h1.page {

    font-size: 1.9rem;

    text-align: left;

  }



  body.portal-home .portal-intro {

    text-align: left;

  }

}



/* =========================================================

   Robot Brand Status

   ========================================================= */



/* 状态标签通用样式 */

.status-ready,

.status-soon {

  display: inline-block;

  margin-bottom: 0.7rem;

  padding: 0.22rem 0.65rem;

  border-radius: 999px;

  font-size: 0.78rem;

  font-weight: 700;

}



/* 已接入 */

.status-ready {

  color: #146c43;

  background: #e7f6ed;

  border: 1px solid #b7dfc7;

}



/* 即将支持 */

.status-soon {

  color: #667085;

  background: #f2f4f7;

  border: 1px solid #d0d5dd;

}



/* 尚未接入的机器人卡片 */

.robot-card-disabled {

  background: #f8fafc;

  border-style: dashed;

  box-shadow: none;

}



/* 禁用卡片不要产生明显悬浮 */

.robot-card-disabled:hover {

  transform: none;

  border-color: var(--robot-border);

  box-shadow: none;

}



/* 禁用卡片标题 */

.doc .robot-card-disabled h3 {

  color: #667085;

}



/* 禁用卡片正文 */

.robot-card-disabled p {

  color: #7c8799;

}



/* =========================================================
   Robot Brand Logo

   统一规则：
   1. 所有品牌 Logo 显示高度完全一致
   2. 宽度根据 SVG 原始宽高比自动计算
   3. 不拉伸、不裁切
   4. 状态标签始终位于 Logo 下方
   ========================================================= */

.brand-card-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;

  gap: 0.65rem;

  margin-bottom: 0.85rem;
}


/* ---------------------------------------------------------
   AsciiDoc image:: 生成的 imageblock
   --------------------------------------------------------- */

.brand-card-head .imageblock.brand-logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;

  height: var(--robot-brand-logo-height);

  margin: 0;
  padding: 0;
}


/* AsciiDoc imageblock 内部 content */
.brand-card-head .imageblock.brand-logo .content {
  display: flex;
  align-items: center;
  justify-content: flex-start;

  height: 100%;

  margin: 0;
  padding: 0;
}


/* ---------------------------------------------------------
   真正的 SVG / PNG

   关键：
   高度统一，宽度自动按图片比例计算。
   不再使用 max-width 限制正常 Logo。
   --------------------------------------------------------- */

.brand-card-head .imageblock.brand-logo img {
  display: block;

  height: var(--robot-brand-logo-height) !important;
  width: auto !important;

  max-height: none;
  max-width: none;

  object-fit: contain;
}


/* 兼容 role 直接落在 img 上的情况 */
.brand-card-head img.brand-logo {
  display: block;

  height: var(--robot-brand-logo-height) !important;
  width: auto !important;

  max-height: none;
  max-width: none;

  object-fit: contain;
}


/* ---------------------------------------------------------
   状态标签
   --------------------------------------------------------- */

.brand-card-head .status-ready,
.brand-card-head .status-soon {
  position: static;

  display: inline-block;

  margin: 0;

  flex-shrink: 0;
}


/* AsciiDoc 可能给状态生成段落，清除默认间距 */
.brand-card-head p {
  margin: 0;
}

/* =========================================================

   Top Navigation Dropdown

   ========================================================= */



.navbar-dropdown {

  min-width: 190px;

  padding: 0.45rem 0;

  border-top: 3px solid #2f6fd0;

  border-radius: 0 0 6px 6px;

  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.14);

}



.navbar-dropdown .navbar-item {

  padding: 0.65rem 1rem;

  color: #24344d;

  font-weight: 500;

  background: #fff;

}



.navbar-dropdown .navbar-item:hover {

  background: #edf3fb;

  color: #0b4f9c;

}



.navbar-link {

  font-weight: 600;

}



/* 网站标题不要被普通菜单规则影响 */

.robot-site-title {

  font-size: 1.25rem;

  font-weight: 700;

}



/* =========================================================

   Documentation Version Selector

   ========================================================= */



.robot-page-versions {

  margin-left: auto;

  white-space: nowrap;

}





/* ---------------------------------------------------------

   多版本：可点击版本按钮

   --------------------------------------------------------- */



.robot-page-versions .robot-version-toggle {

  display: flex;

  align-items: center;

  gap: 0.4rem;



  min-height: 2rem;



  /*

   * 重点：

   * 右边必须给 Antora 默认 chevron 箭头预留空间

   */

  padding:

    0.35rem

    2rem

    0.35rem

    0.65rem;



  background-position:

    right 0.6rem center;



  background-size:

    auto 0.7em;



  border-radius: 4px;



  font-size: 0.86rem;

}





/* ---------------------------------------------------------

   单版本：静态版本显示，无下拉箭头

   --------------------------------------------------------- */



.version-display-static {

  display: flex;

  align-items: center;

  gap: 0.4rem;



  min-height: 2rem;



  padding:

    0.35rem

    0.65rem;



  font-size: 0.86rem;

}





/* ---------------------------------------------------------

   版本文字

   --------------------------------------------------------- */



.version-label {

  color: #667085;

  font-weight: 400;

}



.version-current {

  color: #1d2939;

  font-weight: 700;

}





/* ---------------------------------------------------------

   最新版本标签

   --------------------------------------------------------- */



.version-latest-badge {

  display: inline-block;



  padding:

    0.12rem

    0.45rem;



  border:

    1px solid #b7dfc7;



  border-radius:

    999px;



  background:

    #e7f6ed;



  color:

    #146c43;



  font-size:

    0.7rem;



  font-weight:

    700;

}





/* ---------------------------------------------------------

   下拉菜单

   --------------------------------------------------------- */



.robot-version-menu {

  min-width: 210px;



  padding:

    2.4rem

    0.45rem

    0.45rem;



  align-items:

    stretch;

}





/* ---------------------------------------------------------

   每一个版本

   --------------------------------------------------------- */



.robot-version-menu .version {

  display: flex;



  align-items: center;

  justify-content: space-between;



  gap: 1rem;



  padding:

    0.55rem

    0.65rem;



  border-radius:

    4px;

}





/*

 * Antora 默认 UI 会把当前版本从下拉菜单隐藏。

 *

 * 我们这里希望：

 *

 * 1.2   最新

 * 1.1   历史版本

 * 1.0   历史版本

 *

 * 所以重新显示当前版本。

 */

.robot-version-menu .version.is-current {

  display: flex;

  font-weight: 700;



  background:

    #f1f5fb;

}





/* 版本号 */



.version-number {

  white-space: nowrap;

}





/* ---------------------------------------------------------

   状态标签

   --------------------------------------------------------- */



.version-status {

  white-space: nowrap;



  padding:

    0.12rem

    0.4rem;



  border-radius:

    999px;



  font-size:

    0.68rem;

}





/* 最新 */



.version-status-latest {

  color:

    #146c43;



  background:

    #e7f6ed;



  border:

    1px solid #b7dfc7;

}





/* 历史 */



.version-status-history {

  color:

    #667085;



  background:

    #f2f4f7;



  border:

    1px solid #d0d5dd;

}





/* 页面在某个版本不存在 */



.robot-version-menu .version.is-missing {

  opacity:

    0.55;



  font-style:

    italic;

}

/* =========================================================
   Documentation Video
   ========================================================= */

.doc .videoblock {
  width: 100%;
  margin: 1.25rem 0;
}

.doc .videoblock video {
  display: block;

  max-width: 100%;
  height: auto;

  margin: 0 auto;

  border-radius: 4px;
}