/* Small readability tweaks for the Shermo manual pages. */
.md-typeset {
  font-size: 0.78rem;
}

.md-typeset pre,
.md-typeset pre code {
  font-size: 0.72rem;
}

/* 表格按内容宽度居中显示（Word 里表格是随文的独立块，居中更接近原貌）。
   Material 的 JS 会在运行时把 table 包进 .md-typeset__table，并对其内的
   table 设了 `html .md-typeset__table table{width:100%}`，优先级高于下面这条
   table:not([class])，所以真正生效的居中要加在包裹层上。 */
.md-typeset__table {
  display: block !important;
  width: fit-content !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.md-typeset table:not([class]) {
  display: table;
  width: auto !important;
  max-width: 100%;
  margin-left: auto !important;
  margin-right: auto !important;
  font-size: 0.68rem;
}

/* 让表头列可以收窄（默认 min-width 5rem 会把宽表顶出容器），表头按空格换行 */
.md-typeset table:not([class]) th {
  min-width: 3.5rem;
}

.md-typeset table:not([class]) > thead > tr > th,
.md-typeset table:not([class]) > tbody > tr > td {
  padding: 0.45em 0.55em;
}

/* long console output should scroll rather than overflow the page */
.md-typeset pre {
  overflow-x: auto;
}

/* equations that are wider than the text column */
.md-typeset .arithmatex {
  overflow-x: auto;
  overflow-y: hidden;
}

.md-footer-meta__inner {
  display: flex !important;
  justify-content: center !important;
  text-align: center !important;
  padding-top: 2px !important;    /* 关键：去掉或大幅减小默认的巨大上内边距 */
  padding-bottom: 2px !important; /* 关键：减小下内边距 */
}

.md-copyright {
  color: #ffffff !important;
  width: 100% !important;
  text-align: center !important;
  font-weight: 500; /* 可选：稍作加粗让亮白更醒目清晰 */
  font-size: 0.75rem; /* 可选：稍微调小一点字号，视觉上更精致紧凑 */
  line-height: 0.8 !important; /* 缩小行高 */
  margin: 0 !important; /* 消除默认外边距 */
}

.md-footer-meta {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  z-index: 100 !important; /* 确保浮在正文内容之上 */
  background-color: #483D8B !important;
  padding: 4px 0 !important; /* 关键：压缩外层上下内边距（可根据喜好改为 0~6px） */
}

.md-main__inner {
  margin-bottom: 36px !important;
}

/* 左侧主导航栏标题容器 */
.md-nav--primary > label.md-nav__title {
  display: block !important;
  text-align: center !important;
  justify-content: center !important;
  font-size: 0 !important; /* 隐藏原本的文字 */
}

/* 替换为黑色、居中的 Contents: */
.md-nav--primary > label.md-nav__title::after {
  content: "Contents";
  display: block !important;
  text-align: center !important;
  font-size: 0.85rem !important; /* 恢复字号 */
  font-weight: bold !important;
  color: #483D8B !important;     /* 纯黑 */
}

/* 顶级条目（Home、1. Overview）也加粗：
   主题只对带子项的章标题（.md-nav__item--section）设了 font-weight:700，
   这两个没有子项，看起来就和各章标题不一致了 */
.md-nav--primary > .md-nav__list > .md-nav__item > .md-nav__link,
.md-nav--primary > .md-nav__list > .md-nav__item > .md-nav__container > .md-nav__link {
  font-weight: 700;
}

/* 章内二级条目（2.1 Install、3.2 Showing …）缩进，层次更清楚。
   主题的 .md-nav__list padding 在这里不足以看出差别，故显式加左内边距 */
.md-nav--primary > .md-nav__list > .md-nav__item--nested > .md-nav > .md-nav__list {
  padding-left: 1.15rem !important;
  border-left: 1px solid var(--md-default-fg-color--lightest);
  margin-left: 0.5rem;
}

/* 二级列表：空心圆 */
.md-typeset ul li ul {
  list-style-type: circle !important;
}

/* 三级列表（如有）：实心小方块 */
.md-typeset ul li ul li ul {
  list-style-type: square !important;
}

/* 四级及更深层级列表：横杠破折号（可选） */
.md-typeset ul li ul li ul li ul {
  list-style-type: "- " !important;
}

/* 右侧页内导航标题：隐藏原文并居中替换为 Subparts */
.md-nav--secondary > .md-nav__title {
  display: block !important;
  text-align: center !important;
  justify-content: center !important;
  font-size: 0 !important;
}

.md-nav--secondary > .md-nav__title::after {
  content: "Subparts";
  display: block !important;
  text-align: center !important;
  font-size: 0.85rem !important;
  font-weight: bold !important;
  color: #483D8B !important;
}

/* 段落居中（Word 中 w:jc=center 的段落，如命令示例、"==== x ====" 分隔行） */
.md-typeset .center {
  text-align: center;
}

/* 只有 "Information needed" 提示框（带 center 类）正文居中；
   其余 note 框一律保持默认左对齐 */
.md-typeset .admonition.center > p:not(.admonition-title),
.md-typeset .admonition.center > ul,
.md-typeset .admonition.center > ol {
  text-align: center !important;
}

/* 但标题 "Information needed" 仍保持左对齐：
   .center 类会把整个框的文字居中，标题也跟着居中了，这里再扳回来 */
.md-typeset .admonition.center > .admonition-title {
  text-align: left !important;
}

/* 居中后列表符号会破坏观感，故去掉列表圆点 */
.md-typeset .admonition.center > ul,
.md-typeset .admonition.center > ol {
  list-style: none !important;
  margin-left: 0 !important;
  padding-left: 0 !important;
}

h1 {
  margin-top: 1.3em !important;
  margin-bottom: 0em !important;
}


mjx-container[jax="CHTML"][display="true"],
mjx-container[display="true"] {
  margin: 0.2em 0 !important;
  padding: 0 !important;
}

.md-sidebar__scrollwrap {
  padding-bottom: 40px !important;
}

/* A block of commands typed into Multiwfn: the manual sets these lines apart from
   the surrounding prose, so the page does too — grey rounded border on a very light
   grey background. The class is emitted by mw_conv2 (auto_br detection). */
.md-typeset .mw-cmd {
  border: 1px solid #cccccc;
  border-radius: 6px;
  background-color: #f7f7f7;
  padding: 0.55rem 0.8rem;
  margin: 0.8rem 0;
}
.md-typeset .mw-cmd > br {
  line-height: 1.7;
}

/* Word centres every table cell (w:jc="center" throughout the document), so the
   page must too. Without this only the header row is centred. */
/* Material ships
     .md-typeset table:not([class]) td:not([align]){text-align:left}
   whose extra :not([align]) gives it a HIGHER specificity than a plain
   	d selector, so the first attempt was overruled. Match that selector
   exactly (and the plain form as a fallback). */
.md-typeset table:not([class]) td:not([align]),
.md-typeset table:not([class]) th:not([align]),
.md-typeset table:not([class]) td,
.md-typeset table:not([class]) th {
  text-align: center !important;
}

/* 右侧 Subparts 也画出层级竖线，与左侧 Contents 的观感一致。
   左侧那根线是本文件上面 .md-nav--primary …--nested > .md-nav > .md-nav__list
   的 border-left；右侧（.md-nav--secondary）的标题嵌套用的是同一套结构
   （li.md-nav__item > nav.md-nav > ul.md-nav__list，只是不带 --nested），
   主题只给了 padding-left:.6rem，没有线。
   只改这一个选择器，不动左侧与其它任何地方；右侧栏比左侧窄，
   故内边距取 0.8rem（左侧是 1.15rem），线距文字仍清楚可见。 */
.md-nav--secondary .md-nav__item > .md-nav > .md-nav__list {
  border-left: 1px solid var(--md-default-fg-color--lightest);
  margin-left: 0.35rem;
  padding-left: 0.8rem !important;
}

/* 页面顶端的「Last page / Next page」按钮（DOM 由 javascripts/pager.js 插入）。
   只作用于 .mw-pager，不影响主题自身的任何部分；颜色全部走主题变量，
   故浅色/深色模式都会自动跟随。 */
.mw-pager {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 1.1rem;
  font-size: 0.68rem;
  line-height: 1.35;
}

.mw-pager__link {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 6px;
  background-color: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  text-decoration: none !important;
  transition: border-color 0.15s, background-color 0.15s;
}

.mw-pager__link--next {
  text-align: right;
}

.mw-pager__link--none {
  visibility: hidden;
}

.mw-pager__link:hover {
  border-color: var(--md-accent-fg-color);
  background-color: var(--md-default-fg-color--lightest);
}

.mw-pager__dir {
  font-weight: 700;
  color: var(--md-primary-fg-color);
}

.mw-pager__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.85;
}

/* 页头标题整块可点击：<a> 由 javascripts/header-title.js 添加，点击**回到本页页首**
   （与 Material 自带的 "Back to top" 一致；不再跳首页 —— 滚动后标题会变成当前页名，
   此时跳首页很反直觉）。绝对定位铺满 .md-header__title —— 不参与布局，
   故版式与原来完全一致。仅加 position:relative 作定位上下文。 */
.md-header__title {
  position: relative;
}

.md-header__toplink {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 2px;
}

/* 悬停时给标题文字加下划线作为"可点"的提示（浏览器不支持 :has() 时
   只是没有下划线，功能不受影响） */
.md-header__title:has(.md-header__toplink:hover) .md-header__topic .md-ellipsis {
  text-decoration: underline;
}

/* 页头 logo 放大到与紫色导航栏等高。
   实测：栏高 48px = 2.4rem（1rem = 20px），而 logo 图默认只有 1.2rem = 24px。
   主题给 logo 按钮带了 padding:.4rem + margin:.2rem，若不去掉垂直方向，
   图变高后会把整条栏一起撑高（其它内容跟着位移）——所以垂直方向清零，
   水平方向保留原间距。这样 logo 恰为 48px，与栏等高，且栏高不变。 */
.md-header__button.md-logo {
  margin: 0 .2rem;
  padding: 0;
}

.md-header__button.md-logo img {
  display: block;
  height: 2.4rem;
  width: auto;
}
