/* PRD 文档通用样式覆盖 */

/* 1. 头部：白底黑字 + 缩窄 */
.header {
  background: #fff !important;
  color: #222 !important;
  padding: 14px 40px !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08) !important;
  border-bottom: 1px solid #e8e8e8;
}
.header h1 {
  font-size: 18px !important;
  font-weight: 600;
  color: #222 !important;
}
.header .meta {
  font-size: 12px !important;
  opacity: 1 !important;
  margin-top: 4px !important;
  color: #888 !important;
}
.header .meta span {
  background: #f5f5f5 !important;
  color: #666 !important;
  padding: 2px 8px !important;
  border-radius: 4px;
}

/* 2. 导航栏与头部一起固定（top由JS动态计算） */
.nav-bar {
  position: sticky !important;
  top: var(--header-height, 80px) !important;
  z-index: 99 !important;
  background: #fff !important;
  border-bottom: 1px solid #e8e8e8;
  padding: 8px 40px !important;
}
.nav-bar a:hover {
  background: #ff6b35 !important;
  color: #fff !important;
}

/* 3. 左侧导航 */
.sidebar-toggle {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 200;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-left: none;
  border-radius: 0 6px 6px 0;
  padding: 8px 6px;
  cursor: pointer;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.08);
  font-size: 14px;
  line-height: 1;
  color: #666;
  transition: all 0.2s;
}
.sidebar-toggle:hover {
  background: #f5f5f5;
  color: #222;
}
.sidebar-toggle.active {
  left: 240px;
}

.sidebar {
  position: fixed;
  left: -260px;
  top: 0;
  width: 240px;
  height: 100vh;
  background: #fff;
  border-right: 1px solid #e8e8e8;
  box-shadow: 2px 0 12px rgba(0,0,0,0.06);
  z-index: 199;
  overflow-y: auto;
  padding: 16px 0;
  transition: left 0.25s ease;
}
.sidebar.open {
  left: 0;
}
.sidebar .sidebar-title {
  font-size: 13px;
  font-weight: 600;
  color: #888;
  padding: 0 16px 10px;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 8px;
}
.sidebar .toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar .toc-list li {
  margin: 0;
}
.sidebar .toc-list li a {
  display: block;
  font-size: 13px;
  color: #555;
  text-decoration: none;
  padding: 6px 16px;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar .toc-list li a:hover {
  background: #fff8f5;
  color: #ff6b35;
  border-left-color: #ff6b35;
}
.sidebar .toc-list li a.active {
  background: #fff3ed;
  color: #ff6b35;
  font-weight: 500;
  border-left-color: #ff6b35;
}

/* 4. 有侧边栏打开时内容区偏移 */
body.sidebar-open .header,
body.sidebar-open .nav-bar {
  padding-left: 260px !important;
}
body.sidebar-open .container {
  margin-left: 240px;
}

/* 响应式 */
@media (max-width: 900px) {
  .header { padding: 12px 16px !important; }
  .nav-bar { padding: 8px 16px !important; top: 48px !important; }
  .sidebar-toggle.active { left: 200px; }
  .sidebar { width: 200px; }
  body.sidebar-open .header,
  body.sidebar-open .nav-bar { padding-left: 216px !important; }
  body.sidebar-open .container { margin-left: 200px; }
}
