/* 强制深色模式自定义颜色 深空宇宙（Deep Space）配色方案 */
[data-md-color-scheme="slate"] {
  /* 主背景：极深蓝黑，比纯黑更有层次 */
  --md-default-bg-color: #0b0f19;
  --md-default-fg-color: #e2e8f0;
  
  /* 导航栏/主色：深邃靛蓝 */
  --md-primary-fg-color: #1e293b;
  --md-primary-bg-color: #f8fafc;
  
  /* 强调色：宇宙青（类似伽马射线可视化常用的青色） */
  --md-accent-fg-color: #22d3ee;
  
  /* 链接颜色 */
  --md-typeset-a-color: #38bdf8;
  
  /* 代码块：稍浅的深蓝 */
  --md-code-bg-color: #151b2b;
  --md-code-fg-color: #e2e8f0;
  
  /* 边框/分割线 */
  --md-border-color: #1e293b;
  
  /* 新增：定义标题栏高度变量，方便统一调整 */
  --grid-header-height: 4rem;  /* 修改为64px，与logo同高，消除多余空白 */
}



/* 隐藏 site_name 文字 */
.md-header__title,
.md-header__ellipsis {
  display: none !important;
}



/* 调整左上角 logo 大小 */
.md-header__button.md-logo {
  padding: 0 0.4rem;  /* 调整内边距：去除上下padding，仅靠64px高度撑开header */
  display: flex;      /* 确保flex布局消除额外间隙 */
  align-items: center;
}

.md-header__button.md-logo img {
  height: 64px;     /* 设置高度，宽度自适应 */
  width: auto;
  display: block;  /* 消除图片底部间隙 */
}

/* 显式设置标题栏高度，确保能容纳 Logo 和搜索框 */
.md-header {
  min-height: var(--grid-header-height);
  height: auto;  /* 允许内容撑高，但受限于 min-height */
  max-height: var(--grid-header-height);  /* 新增：限制最大高度，防止被内部元素撑开 */
}

/* 调整内部 flex 布局，确保垂直居中 */
.md-header__inner {
  position: relative;  /* 关键修复：为搜索框absolute定位提供参考上下文，否则搜索框会相对于视口定位 */
  align-items: center;
  height: auto;
  min-height: var(--grid-header-height);
  padding: 0 0.5rem;  /* 去除上下padding（原0.5rem top/bottom），保留左右，避免header被撑高 */
}

/* 960px 断点（让 iPad/平板横屏显示侧边栏，竖屏仍用汉堡菜单） */
@media screen and (min-width: 960px) and (max-width: 1219px) {
  .md-tabs { 
    display: block !important; 
    font-size: 1rem !important;  /* 强制与 PC 端字号一致 */
  }
  .md-header__button[for="__drawer"] { 
    display: none !important; 
  }
}

/* 桌面端搜索框定位（横屏 ≥960px） */
@media screen and (min-width: 960px) {
  .md-search {
    position: absolute;
    right: 1rem !important;
    /* 改为基于 header 高度的垂直居中，而非固定 55px */
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 200px !important;
    margin: 0 !important;
    /* 确保展开时不被截断 */
    max-height: var(--grid-header-height);
  }  
  
  /* 可选：如果想让搜索框在标题栏底部（原意图的"右下角"），改用： */
  /*
  .md-search {
    position: absolute;
    right: 1rem !important;
    bottom: 0.5rem !important;  // 距离底部留空隙
    top: auto !important;
    transform: none !important;
    width: 200px !important;
  }
  */
}

/* 移动端改用搜索图标定位（竖屏 <960px） */
@media screen and (max-width: 959px) {
  /* 恢复默认相对定位，避免 absolute 导致布局错乱 */
  .md-search {
    position: relative !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
    width: auto !important;  /* 允许 Material 默认宽度 */
    margin-right: 0.5rem !important;
    flex: 0 0 auto;
  }  
  
  /* 如果需要在移动端也强制显示搜索框（而非默认的图标模式），添加： */
  /*
  .md-search__input {
    width: 150px;
    opacity: 1;
    position: relative;
  }
  .md-search__icon[for="__search"] {
    display: none;  
  }
  */
  
  /* 移动端标题栏高度可适当减小，但确保 logo 不溢出 */
  :root {
    --grid-header-height: 4rem;  /* 修改为与桌面端一致，保持64px，消除多余空白 */
  }
  
  /* 移动端搜索框展开时的特殊处理 */
  .md-search__overlay {
    top: var(--grid-header-height);
  }
}

/* 额外优化：确保搜索框展开时覆盖整个页面宽度（Material 默认行为） */
.md-search__inner {
  width: 100%;
}



/* 正文第一行的页面标（H1）加粗 */
.md-content__inner > h1:first-child {
  font-weight: bold !important;  /* 特粗，可改为 700 或 bold */
  color: var(--md-default-fg-color) !important;  /* #e2e8f0，柔和灰白 */
  padding-top: 1rem !important;  /* 与上方 Tabs 留出 1rem 间距 */
}
/* 隐藏正文第一行的页面标题 */
/* .md-content__inner > h1:first-child {
  display: none;
} */



/* 香槟金 / 淡金 - 优雅不刺眼 */
.badge-g {
  color: #E6C875;
  font-weight: bold;
  text-shadow: 0 0 4px rgba(230, 200, 117, 0.6), 
               0 0 8px rgba(230, 200, 117, 0.3);
}

/* 月光银 - 冷调明亮 */
.badge-s {
  color: #E8F1F2;
  font-weight: bold;
  text-shadow: 0 0 4px rgba(232, 241, 242, 0.5), 
               0 0 8px rgba(232, 241, 242, 0.2);
}

/* 古铜 / Bronze - 沉稳厚重，金属三部曲 */
.badge-b {
  color: #C9A87C;
  font-weight: bold;
  text-shadow: 0 0 4px rgba(201, 168, 124, 0.6), 
               0 0 8px rgba(201, 168, 124, 0.3);
}

