/* 帮助文档页面样式 */

/* 主容器 */
.help-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 20px;
  display: flex;
  gap: 32px;
  min-height: calc(100vh - 200px);
}

/* 移动端顶部导航 */
.mobile-top-nav {
  display: none;
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  background-color: #fff;
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1001;
  justify-content: space-between;
  align-items: center;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
  background-color: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
  background-color: #5a6fdd;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 移动端目录按钮 */
.mobile-toc-btn {
  background-color: #f0f4f8;
  color: #333;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mobile-toc-btn:hover {
  background-color: #e2e8f0;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 左侧导航 */
.help-sidebar {
  width: 240px;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 24px;
  position: sticky;
  top: 100px;
  height: fit-content;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  transition: all 0.3s ease;
}

.help-sidebar::-webkit-scrollbar {
  width: 6px;
}

.help-sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.help-sidebar::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.help-sidebar::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

.sidebar-title {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-item {
  margin-bottom: 8px;
}

.nav-category {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.nav-category:hover {
  background-color: #f0f4f8;
  color: #667eea;
}

.nav-category.active {
  background-color: #667eea;
  color: #fff;
}

.nav-category-icon {
  font-size: 12px;
  transition: transform 0.3s ease;
  display: inline-block;
}

.nav-category.active .nav-category-icon {
  transform: rotate(90deg);
}

.nav-submenu {
  list-style: none;
  padding: 0;
  margin: 8px 0 16px 16px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.nav-submenu.active {
  max-height: 500px;
  opacity: 1;
  transform: translateY(0);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-subitem {
  margin-bottom: 6px;
}

.nav-subitem a {
  display: block;
  padding: 6px 12px;
  font-size: 13px;
  color: #666;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.nav-subitem a:hover {
  background-color: #f0f4f8;
  color: #667eea;
  transform: translateX(4px);
}

.nav-subitem a.active {
  background-color: #667eea;
  color: #fff;
}

/* 中间内容 */
.help-content {
  flex: 1;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 40px;
  min-width: 0;
}

.content-header {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e5e7eb;
}

.content-title {
  font-size: 28px;
  font-weight: 700;
  color: #333;
  margin-top: 16px;
}

.content-search {
  position: relative;
  max-width: 400px;
}

.content-search input {
  width: 100%;
  padding: 12px 40px 12px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.content-search input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.content-search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  font-size: 16px;
}

.content-body {
  line-height: 1.6;
  color: #333;
}

.content-section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.section-content {
  margin-bottom: 24px;
}

.section-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 16px 0;
  display: block;
}

.section-content iframe {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 16px 0;
}

.section-content pre {
  background-color: #f8f9fa;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 16px 0;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
}

.section-content code {
  background-color: #f8f9fa;
  padding: 2px 4px;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
}

.section-subtitle {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin: 24px 0 16px;
}

.content-body p {
  margin-bottom: 16px;
  font-size: 14px;
  color: #666;
}

.content-body a {
  color: #667eea;
  text-decoration: none;
  transition: color 0.3s ease;
}

.content-body a:hover {
  color: #5a6fdd;
  text-decoration: underline;
}

.content-body ul {
  margin-bottom: 16px;
  padding-left: 24px;
}

.content-body li {
  margin-bottom: 8px;
  font-size: 14px;
  color: #666;
}

/* 右侧目录 */
.help-toc {
  width: 280px;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 24px;
  position: sticky;
  top: 100px;
  height: fit-content;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.help-toc::-webkit-scrollbar {
  width: 6px;
}

.help-toc::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.help-toc::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.help-toc::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

.toc-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 16px;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-item {
  margin-bottom: 8px;
}

.toc-item a {
  display: block;
  padding: 6px 12px;
  font-size: 13px;
  color: #666;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.toc-item a:hover {
  background-color: #f0f4f8;
  color: #667eea;
  transform: translateX(4px);
}

.toc-item a.active {
  background-color: #667eea;
  color: #fff;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .help-container {
    gap: 24px;
  }
  
  .help-sidebar {
    width: 200px;
    padding: 20px;
  }
  
  .help-toc {
    width: 240px;
    padding: 20px;
  }
  
  .help-content {
    padding: 32px;
  }
}

@media (max-width: 992px) {
  .mobile-top-nav {
    display: flex;
  }
  
  .help-container {
    flex-direction: column;
  }
  
  .help-sidebar {
    width: 100%;
    position: fixed;
    top: 110px;
    left: -100%;
    bottom: 0;
    max-height: none;
    margin-bottom: 0;
    border-radius: 0;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow-y: auto;
  }
  
  .help-sidebar.active {
    left: 0;
  }
  
  .help-toc {
    width: 100%;
    position: fixed;
    top: 110px;
    right: -100%;
    bottom: 0;
    max-height: none;
    margin-top: 0;
    border-radius: 0;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
  }
  
  .help-toc.active {
    right: 0;
  }
  
  .help-content {
    width: 100%;
    margin-top: 60px;
  }
  
  .nav-submenu {
    display: none;
  }
  
  .nav-submenu.active {
    display: block;
  }
  
  .nav-category-icon {
    display: inline;
  }
}

@media (max-width: 768px) {
  .help-container {
    padding: 20px 16px;
    gap: 16px;
  }
  
  .help-sidebar {
    padding: 16px;
  }
  
  .help-content {
    padding: 24px;
  }
  
  .help-toc {
    padding: 16px;
  }
  
  .content-title {
    font-size: 24px;
  }
  
  .section-title {
    font-size: 18px;
  }
  
  .section-subtitle {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .help-content {
    padding: 16px;
  }
  
  .content-title {
    font-size: 20px;
  }
  
  .section-title {
    font-size: 16px;
  }
  
  .content-body p,
  .content-body li {
    font-size: 13px;
  }
}

/* 动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.help-sidebar,
.help-content,
.help-toc {
  animation: fadeInUp 0.6s ease-out;
}

.help-sidebar {
  animation-delay: 0.1s;
}

.help-content {
  animation-delay: 0.2s;
}

.help-toc {
  animation-delay: 0.3s;
}
