/* 自定义样式 */

/* 表格容器 - 移除宽度限制 */
.md-typeset__scrollwrap {
  overflow-x: visible;
}

.md-typeset__table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

/* 增强表格样式 */
.md-typeset table:not([class]) {
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.2rem;
  font-size: 0.85rem;
  width: 100%;
  display: table;
}

.md-typeset table:not([class]) th,
.md-typeset table:not([class]) td {
  white-space: nowrap;
  padding: 0.6rem 1rem;
}

.md-typeset table:not([class]) th {
  background-color: var(--md-primary-fg-color--light);
  color: var(--md-primary-bg-color);
  font-weight: 700;
}

/* 让公式列可以换行 */
.md-typeset table:not([class]) td:nth-child(2) {
  white-space: normal;
  min-width: 300px;
}

/* 扩大内容区域宽度 */
.md-content {
  max-width: none;
}

.md-main__inner {
  max-width: none;
}

/* 主内容区域更宽 */
@media screen and (min-width: 76.25em) {
  .md-content {
    margin-left: 0;
    margin-right: 0;
  }
}

/* 代码块优化 */
.md-typeset code {
  background-color: var(--md-code-bg-color);
  border-radius: 0.2rem;
  padding: 0.1rem 0.3rem;
}

/* 块级数学公式居中（$$...$$）*/
div.arithmatex {
  display: block;
  text-align: center;
  margin: 1em 0;
}

/* 行内数学公式保持行内显示（$...$）*/
span.arithmatex {
  display: inline;
}

/* 中文字体优化 */
.md-typeset {
  font-family: "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.8;
}

/* 改善代码块中文显示 */
.md-typeset pre code {
  font-family: "JetBrains Mono", "Noto Sans Mono CJK TC", Consolas, Monaco, monospace;
}

/* Grid Cards 样式 */
.grid.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.grid.cards > ul {
  display: contents;
  list-style: none;
  margin: 0;
  padding: 0;
}

.grid.cards > ul > li {
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.5rem;
  padding: 1.5rem;
  transition: all 0.2s ease;
}

.grid.cards > ul > li:hover {
  border-color: var(--md-primary-fg-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.grid.cards > ul > li > p:first-child {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.grid.cards > ul > li > hr {
  border: none;
  border-top: 1px solid var(--md-default-fg-color--lightest);
  margin: 0.75rem 0;
}

.grid.cards > ul > li > p:last-child {
  margin-bottom: 0;
}

.grid.cards > ul > li a {
  color: var(--md-primary-fg-color);
  font-weight: 500;
}

/* 隱藏底部 footer */
.md-footer {
  display: none;
}

/* 分類標題樣式（下拉選單） */
.md-nav__item--nested > .md-nav__link {
  font-weight: 600;
  font-size: 0.8rem;
}

/* 子項目縮排 */
.md-nav--secondary .md-nav__list,
.md-nav__item--nested .md-nav .md-nav__list {
  padding-left: 1.5em;
}

/* 左側導航字體大小 */
.md-nav__link {
  font-size: 0.8rem;
}
