/* mdBook 侧边栏与内容区优化 */

/* ===== 侧边栏宽度 ===== */
.sidebar { width: 320px !important; }
.page-wrapper { margin-left: 320px; }

/* ===== 内容区 80% 居中 ===== */
.markdown-section {
  max-width: 960px;
  margin: 0 auto;
  width: 80%;
  padding: 24px 0;
}

/* ===== 侧边栏条目 ===== */
.chapter li.chapter-item { line-height: 1.8em !important; }
.chapter li.chapter-item > a {
  display: block; padding: 1px 8px;
  border-radius: 4px;
  font-size: 13.5px;
}
.chapter li.chapter-item > a:hover { background: #eef2f5; }
.chapter li.chapter-item:has(+ li > ol) > a { font-weight: 600; color: #1f2328 !important; }
.chapter li.chapter-item:not(:has(+ li > ol)) > a {
  font-weight: 400; color: #57606a !important;
  padding-left: 28px; font-size: 13px;
}
.chapter li.chapter-item > a.active,
.chapter li.chapter-item > a.active:hover {
  background: #ddf4ff !important;
  color: #0550ae !important;
  font-weight: 500 !important;
}
.section {
  border-left: 1px dashed #d0d7de !important;
  margin-left: 8px !important;
  padding-left: 8px !important;
}

/* ===== 隐藏打印 ===== */
.right-buttons { display: none !important; }

/* ===== 菜单栏 ===== */
.menubar { border-bottom: 1px solid #d0d7de !important; }
.left-buttons .icon-button {
  font-size: 16px; padding: 6px 10px; color: #57606a;
}
.left-buttons .icon-button:hover { color: #0969da; }

/* ===== 搜索 ===== */
#searchbar {
  border: 1px solid #d0d7de; border-radius: 8px;
  padding: 8px 12px; font-size: 13px;
}
#searchbar:focus {
  border-color: #0969da;
  box-shadow: 0 0 0 3px rgba(9,105,218,0.12);
}

/* ===== 手机端适配 ===== */
@media (max-width: 768px) {
  .page-wrapper { margin-left: 0 !important; }
  .sidebar { width: 280px !important; }
  .markdown-section {
    width: 94% !important;
    max-width: 100% !important;
    padding: 16px 0;
  }
  .content { padding: 16px 0 !important; }
}
