/* 隐藏 scrollbar
::-webkit-scrollbar {
  display: none;
}*/

/* 文字选取颜色 */
::selection {
  background: aquamarine;
  color: black;
}

/* 正文中的图片：保持原始尺寸（不被强制拉伸），但当宽度超过容器时会按比例缩小到容器宽度 */
.md-content img:not([alt="badge"]) {
  /* 恢复之前的默认行为：图片填充内容宽度并带黑色边框 */
  display: block;
  width: auto; /* 保持自然宽度，超出容器时会缩小到 max-width */
  max-width: 100%;
  height: auto;
  margin-left: auto;
  margin-right: auto;
  border: 3px solid black;
  background: transparent;
  box-sizing: border-box;
}

/* .normal: 保持自然尺寸、无边框并且居中（用于恢复“当前默认效果”） */
.md-content img.normal,
.md-content img.normal.transparent-checker {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: auto; /* 保持自然宽度，超出容器时会缩小到 max-width */
  max-width: 100%;
  height: auto;
  border: none;
  background: transparent;
}

/* 图片缩放工具类（供 Markdown attribute lists 使用）
   使用示例：
     - 百分比缩放： `![alt](img.png){.img-scale-50}`  -> 宽度 50%
     - 与 .normal 组合：  `![alt](img.png){.normal img-scale-50}`
     - 精确像素：        `![alt](img.png){.img-w-320}`        -> 宽度 320px（最大不超过容器）
     - 直接内联样式（最简单，attr_list 支持）：
         `![alt](img.png){.normal style="width:50%"}`

   说明：MkDocs/Markdown 的 attribute list 扩展需要启用（通常在 Material for MkDocs 中已开启 pymdownx.attr_list）。
*/

.md-content img.img-scale-25,
.md-content img.img-scale-33,
.md-content img.img-scale-50,
.md-content img.img-scale-66,
.md-content img.img-scale-75,
.md-content img.img-scale-100,
.md-content img.img-scale-125,
.md-content img.img-scale-150 {
  height: auto;
  /* 保持 max-width 限制（默认图片最大不超过 1280px），但允许宽度按比例设置 */
  max-width: 1280px;
  box-sizing: border-box;
}

.md-content img.img-scale-25  { width: 25%  !important; }
.md-content img.img-scale-33  { width: 33.333% !important; }
.md-content img.img-scale-50  { width: 50%  !important; }
.md-content img.img-scale-66  { width: 66.666% !important; }
.md-content img.img-scale-75  { width: 75%  !important; }
.md-content img.img-scale-100 { width:100%  !important; }
.md-content img.img-scale-125 { width:125%  !important; max-width:none !important; }
.md-content img.img-scale-150 { width:150%  !important; max-width:none !important; }

/* 常用像素宽度类（在小屏上不会超过容器宽度） */
.md-content img.img-w-160  { width:160px  !important; max-width:100% !important; }
.md-content img.img-w-320  { width:320px  !important; max-width:100% !important; }
.md-content img.img-w-640  { width:640px  !important; max-width:100% !important; }
.md-content img.img-w-1280 { width:1280px !important; max-width:100% !important; }

/* 兼容：当用户在 attr_list 中写入 width=50%（某些渲染器会把它变为 width 属性）
   可以使用属性选择器来覆盖情况（可按需扩展更多值） */
.md-content img[width="25%"]  { width:25%  !important; }
.md-content img[width="50%"]  { width:50%  !important; }
.md-content img[width="75%"]  { width:75%  !important; }
.md-content img[width="100%"] { width:100% !important; }

/* 保留调试棋盘格样式（可与 .normal 或其他类一起使用） */

img[alt="logo"] {
  border: none;
}

.md-logo img,
.md-header .md-logo img,
.md-header__title img,
.md-nav__logo img,
.md-header img {
  background: transparent !important;
}

.altium-iframe-viewer {
  height: 400px;
  max-width: 1280px;
  max-height: 700px;
  /*
    border-width: 1px;
    border-style: solid;
    border-radius: 0px 0px 4px 4px;
    overflow: hidden;
    box-sizing: border-box;
    */
}

/*
  iframe{
    height: 450px;
    width: 1280px;
    max-width: 1280px;
    max-height: 700px;
    border-width: 1px;
    border-style: solid;
    border-radius: 0px 0px 4px 4px;
    overflow: hidden;
    box-sizing: border-box;

  }
  */

@font-face {
  font-family: "Noto Sans SC - local";
  src: "NotoSansSC-VariableFont_wght.ttf";
}

/* =================================================================
   IDE GEEK STYLE — MkDocs Material Dark Mode Override
   Accent : Titanium Gray  #A1A1AA
   Content : Deep Black    #0d1117
   Sidebar : Deeper Black  #090c10
   Border  : rgba(255,255,255,.08)  1px solid, no shadows
   ================================================================= */

/* --- 1. Dark mode CSS custom-property overrides --- */
[data-md-color-scheme="slate"] {
  --md-default-bg-color:           #0d1117;
  --md-default-bg-color--light:    rgba(13,17,23,.54);
  --md-default-bg-color--lighter:  rgba(13,17,23,.26);
  --md-default-bg-color--lightest: rgba(13,17,23,.07);

  --md-default-fg-color:           #c9d1d9;
  --md-default-fg-color--light:    rgba(201,209,217,.70);
  --md-default-fg-color--lighter:  rgba(201,209,217,.46);
  --md-default-fg-color--lightest: rgba(201,209,217,.12);

  --md-accent-fg-color:              #A1A1AA;
  --md-accent-fg-color--transparent: rgba(161,161,170,.10);
  --md-typeset-a-color:              #A1A1AA;

  --md-code-bg-color: #161b22;
  --md-code-fg-color: #e6edf3;
}

/* --- Header --- */
[data-md-color-scheme="slate"] .md-header {
  background-color: #090c10 !important;
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: none !important;
}

/* --- Navigation tabs --- */
[data-md-color-scheme="slate"] .md-tabs {
  background-color: #090c10 !important;
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: none !important;
}
[data-md-color-scheme="slate"] .md-tabs__link--active {
  color: #A1A1AA !important;
  font-weight: 600;
}
[data-md-color-scheme="slate"] .md-tabs__link:hover {
  color: #c9d1d9 !important;
}

/* --- Sidebar: IDE vertical dividers --- */
[data-md-color-scheme="slate"] .md-sidebar--primary {
  background-color: #090c10;
  border-right: 1px solid rgba(255,255,255,.08);
}
[data-md-color-scheme="slate"] .md-sidebar--secondary {
  background-color: #0d1117;
  border-left: 1px solid rgba(255,255,255,.08);
}

/* --- Main content background --- */
[data-md-color-scheme="slate"] .md-main,
[data-md-color-scheme="slate"] .md-content {
  background-color: #0d1117;
}

/* --- Remove shadows from common elements --- */
[data-md-color-scheme="slate"] .md-sidebar,
[data-md-color-scheme="slate"] .md-dialog,
[data-md-color-scheme="slate"] .md-search__output,
[data-md-color-scheme="slate"] .md-typeset .admonition,
[data-md-color-scheme="slate"] .md-typeset details,
[data-md-color-scheme="slate"] .md-typeset pre {
  box-shadow: none !important;
}

/* ===== 2. De-Roundedness ===== */
[data-md-color-scheme="slate"] .md-typeset pre,
[data-md-color-scheme="slate"] .md-typeset code,
[data-md-color-scheme="slate"] .md-typeset .highlight,
[data-md-color-scheme="slate"] .md-search__form,
[data-md-color-scheme="slate"] .md-search__input,
[data-md-color-scheme="slate"] .md-search__output,
[data-md-color-scheme="slate"] .md-typeset .admonition,
[data-md-color-scheme="slate"] .md-typeset details,
[data-md-color-scheme="slate"] .md-nav__link {
  border-radius: 0 !important;
}

/* ===== 3. Typography / 8px Grid ===== */
[data-md-color-scheme="slate"] .md-typeset {
  line-height: 1.8;
}
[data-md-color-scheme="slate"] .md-typeset p,
[data-md-color-scheme="slate"] .md-typeset ul,
[data-md-color-scheme="slate"] .md-typeset ol,
[data-md-color-scheme="slate"] .md-typeset dl {
  margin-bottom: 1.5rem;
}
[data-md-color-scheme="slate"] .md-typeset h1,
[data-md-color-scheme="slate"] .md-typeset h2,
[data-md-color-scheme="slate"] .md-typeset h3,
[data-md-color-scheme="slate"] .md-typeset h4,
[data-md-color-scheme="slate"] .md-typeset h5,
[data-md-color-scheme="slate"] .md-typeset h6 {
  margin-top: 2.5rem;
}

/* --- Inline code: JetBrains Mono, subtle style --- */
[data-md-color-scheme="slate"] .md-typeset :not(pre) > code {
  font-family: 'JetBrains Mono','Cascadia Code','Fira Code','Consolas',monospace !important;
  color: #c9d1d9 !important;
  background-color: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  border-radius: 2px !important;
  padding: .08em .32em !important;
  font-size: .83em !important;
}

/* --- Code blocks --- */
[data-md-color-scheme="slate"] .md-typeset pre {
  background-color: #161b22 !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  border-radius: 0 !important;
}
[data-md-color-scheme="slate"] .md-typeset pre code {
  font-family: 'JetBrains Mono','Cascadia Code','Fira Code','Consolas',monospace !important;
  background: transparent !important;
  font-size: .85em !important;
  border: none !important;
  padding: 0 !important;
}

/* ===== 4. Table: Register Map Style ===== */
[data-md-color-scheme="slate"] .md-typeset table {
  width: 100% !important;
  border-radius: 0 !important;
  border-collapse: collapse;
  font-size: .85em;
}
[data-md-color-scheme="slate"] .md-typeset table th,
[data-md-color-scheme="slate"] .md-typeset table td {
  padding: 8px 12px !important;
  border: 1px solid rgba(255,255,255,.08) !important;
}
[data-md-color-scheme="slate"] .md-typeset table th {
  background-color: #161b22 !important;
  color: #A1A1AA !important;
  font-family: 'JetBrains Mono','Consolas',monospace;
  font-size: .8em;
  letter-spacing: .08em;
  text-transform: uppercase;
}
[data-md-color-scheme="slate"] .md-typeset table tr:nth-child(even) td {
  background-color: rgba(255,255,255,.025) !important;
}
[data-md-color-scheme="slate"] .md-typeset table tr:hover td {
  background-color: rgba(161,161,170,.06) !important;
}

/* ===== 5. Sidebar Nav: Bold + Left Indicator (no background fill) ===== */

/* [修改点 1]：左侧主导航 - 激活容器设置 */
[data-md-color-scheme="slate"] .md-nav__link--active {
  font-weight: 700 !important;
  color: #A1A1AA !important;
  background-color: transparent !important;
  /* 必须添加：让白条以这个容器为坐标基准 */
  position: relative;
  /* 关闭原来的内阴影白条 */
  box-shadow: none !important;
}

/* [修改点 2]：新增伪元素，实现可平移的白条 */
[data-md-color-scheme="slate"] .md-nav__link--active::before {
  content: "";
  position: absolute;
  /* 核心：控制左右平移。-10px 代表向左移动 10 像素 */
  left: -12px;
  /* 控制白条的上下缩进，4px 会让它看起来比行高矮一点，更精致 */
  top: 4px;
  bottom: 4px;
  width: 3px;
  background-color: #A1A1AA;
}

/* [保留]：菜单悬停效果，确保鼠标指上去时仍有反馈 */
[data-md-color-scheme="slate"] .md-nav__link:not(.md-nav__link--active):hover {
  background-color: rgba(255,255,255,.04) !important;
  color: #c9d1d9 !important;
}

/* 替换后的逻辑 */
[data-md-color-scheme="slate"] .md-nav--secondary .md-nav__link--active {
  /* ... */
  box-shadow: none !important; /* 彻底清除内阴影 */
  position: relative;          /* 关键：把容器变成一个定位锚点 */
}

[data-md-color-scheme="slate"] .md-nav--secondary .md-nav__link--active::before {
  content: "";
  position: absolute;          /* 关键：让指示条脱离文字排版，独立浮动 */
  left: -10px;                 /* 魔法：通过负值坐标，强行移动到容器左侧外部 */
  /* ...其他形状定义... */
}

/* ===== 6. Search Box ===== */
[data-md-color-scheme="slate"] .md-search__form {
  border-radius: 0 !important;
  background-color: rgba(255,255,255,.05) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  box-shadow: none !important;
  min-width: 240px;
}
[data-md-color-scheme="slate"] .md-search__input {
  border-radius: 0 !important;
  color: #c9d1d9;
}
[data-md-color-scheme="slate"] .md-search__input::placeholder {
  color: rgba(201,209,217,.40);
}
[data-md-color-scheme="slate"] .md-search__output {
  border-radius: 0 !important;
  border: 1px solid rgba(255,255,255,.08);
  border-top: none;
}

/* ===== 7. Metadata box → Code Comment Style ===== */
/* Targets git-revision-date / source-file info strip */
[data-md-color-scheme="slate"] .md-source-file {
  background: transparent !important;
  border-left: 3px solid #A1A1AA !important;
  border-top: none !important;
  border-right: none !important;
  border-bottom: none !important;
  border-radius: 0 !important;
  padding: 6px 16px !important;
  margin-bottom: 1.5rem;
  color: rgba(201,209,217,.55) !important;
  font-family: 'JetBrains Mono','Consolas',monospace;
  font-size: .78em;
  box-shadow: none !important;
}

/* ===== 8. Links ===== */
[data-md-color-scheme="slate"] .md-typeset a {
  color: #A1A1AA !important;
  text-decoration: none;
}
[data-md-color-scheme="slate"] .md-typeset a:hover {
  color: #e6edf3 !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ===== 9. Horizontal rule ===== */
[data-md-color-scheme="slate"] .md-typeset hr {
  border-color: rgba(255,255,255,.08);
}

/* ===== 10. Admonitions ===== */
[data-md-color-scheme="slate"] .md-typeset .admonition,
[data-md-color-scheme="slate"] .md-typeset details {
  background-color: rgba(255,255,255,.02) !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  border-left-width: 3px !important;
  border-radius: 0 !important;
}
[data-md-color-scheme="slate"] .md-typeset .admonition-title,
[data-md-color-scheme="slate"] .md-typeset summary {
  background-color: rgba(255,255,255,.04) !important;
}

/* ===== 11. Text selection ===== */
[data-md-color-scheme="slate"] ::selection {
  background: rgba(161,161,170,.25);
  color: #e6edf3;
}

/* ===== 12. Footer ===== */
[data-md-color-scheme="slate"] .md-footer,
[data-md-color-scheme="slate"] .md-footer-meta {
  background-color: #090c10 !important;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* Home landing page */
:root {
  --jr-home-accent: #0f6bff;
  --jr-home-accent-soft: rgba(15, 107, 255, 0.12);
  --jr-home-surface: linear-gradient(135deg, rgba(15, 107, 255, 0.1), rgba(11, 18, 32, 0.02));
  --jr-home-border: rgba(15, 23, 42, 0.12);
}

[data-md-color-scheme="slate"] {
  --jr-home-accent: #8ab4ff;
  --jr-home-accent-soft: rgba(138, 180, 255, 0.12);
  --jr-home-surface: linear-gradient(135deg, rgba(138, 180, 255, 0.1), rgba(255, 255, 255, 0.02));
  --jr-home-border: rgba(255, 255, 255, 0.1);
}

.landing-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(1.5rem, 4vw, 3rem);
  margin: 0 0 2rem;
  border: 1px solid var(--jr-home-border);
  border-radius: 1.25rem;
  background:
    radial-gradient(circle at top right, var(--jr-home-accent-soft), transparent 34rem),
    var(--jr-home-surface);
}

.landing-hero::after {
  content: "";
  position: absolute;
  inset: auto -3rem -3rem auto;
  width: 12rem;
  height: 12rem;
  border-radius: 999px;
  background: radial-gradient(circle, var(--jr-home-accent-soft), transparent 70%);
  pointer-events: none;
}

.landing-eyebrow {
  margin: 0 0 0.75rem;
  color: var(--jr-home-accent);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.landing-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.1;
}

.landing-lead {
  max-width: 46rem;
  margin: 1rem 0 0;
  font-size: 1.05rem;
  line-height: 1.85;
}

.landing-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.landing-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--jr-home-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  font-size: 0.88rem;
  font-weight: 600;
  backdrop-filter: blur(12px);
}

[data-md-color-scheme="slate"] .landing-chip {
  background: rgba(255, 255, 255, 0.04);
}

.md-typeset .grid.cards > ul > li,
.md-typeset .grid.cards > ol > li {
  border-radius: 1rem;
}

@media screen and (max-width: 45rem) {
  .landing-hero {
    padding: 1.25rem;
    border-radius: 1rem;
  }

  .landing-lead {
    font-size: 0.98rem;
  }
}
