/* 帮助文档页面专用样式 */

/* 移动端顶部导航栏 */
.mobile-navbar {
  position: sticky;
  top: 0;
  z-index: 1040;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 图标按钮样式 */
.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.icon-btn i {
  font-size: 1rem;
}

/* 移动端返回首页按钮去掉边框 */
.icon-btn.btn-outline-primary.d-lg-none {
  border: none;
  background: transparent;
  color: #6366f1;
}

.icon-btn.btn-outline-primary.d-lg-none:hover {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  border: none;
}

/* 主容器布局 */
.help-container {
  display: flex;
  min-height: 100vh; /* 减去导航栏高度 */
}

/* 移动端调整主容器高度 */
@media (max-width: 991.98px) {
  .help-container {
    min-height: calc(100vh - 60px); /* 减去移动端导航栏高度 */
  }
}

/* 面包屑导航响应式优化 */
@media (max-width: 767.98px) {
  .doc-header nav {
    /* 保持水平布局，让面包屑和按钮在同一行 */
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
  }

  .doc-header .breadcrumb {
    margin-bottom: 0;
    flex: 1; /* 让面包屑占据剩余空间 */
  }

  .doc-header .d-flex.gap-2 {
    flex-shrink: 0; /* 防止按钮被压缩 */
  }
}

@media (max-width: 575.98px) {
  .doc-header nav {
    gap: 0.5rem; /* 减少间距以适应小屏幕 */
  }

  .icon-btn {
    width: 32px;
    height: 32px;
  }

  .icon-btn i {
    font-size: 0.9rem;
  }

  /* 在极小屏幕上，面包屑文字可能需要换行或截断 */
  .doc-header .breadcrumb {
    font-size: 0.875rem;
  }
}

/* 左侧边栏 */
.help-sidebar {
  width: 300px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  overflow-y: auto;
  position: sticky;

  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.sidebar-header h5 {
  color: white;
  font-weight: 600;
}

.sidebar-content {
  padding: 1.5rem;
}

/* 搜索框 */
.search-box .input-group-text {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-right: none;
  color: rgba(255, 255, 255, 0.8);
}

.search-box .form-control {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-left: none;
  color: white;
  box-shadow: none;
}

.search-box .form-control::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.search-box .form-control:focus {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

/* 导航树 */
.nav-tree {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* 分类样式 */
.nav-category {
  margin-bottom: 1rem;
}

.category-header {
  display: flex;
  align-items: center;
  padding: 0.75rem 0.5rem;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.category-header:hover {
  background: rgba(255, 255, 255, 0.1);
}

.category-toggle {
  margin-right: 0.5rem;
  font-size: 0.875rem;
  transition: transform 0.2s ease;
  color: rgba(255, 255, 255, 0.8);
}

.category-toggle.collapsed {
  transform: rotate(-90deg);
}

.category-title {
  font-weight: 600;
  color: white;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.category-items {
  list-style: none;
  padding: 0;
  margin: 0;
  padding-left: 1rem;
  overflow: hidden;
  transition: all 0.3s ease;
}

.category-items.collapsed {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
}

.category-items.show {
  max-height: 500px;
  opacity: 1;
}

.nav-tree .nav-item {
  margin-bottom: 0.25rem;
}

.nav-tree .nav-link {
  display: flex;
  align-items: center;
  padding: 0.625rem 1rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-weight: 400;
  font-size: 0.875rem;
  margin: 2px 0;
}

.nav-tree .nav-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  transform: translateX(4px);
}

.nav-tree .nav-link.active {
  background: rgba(255, 255, 255, 0.25);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border-left: 3px solid rgba(255, 255, 255, 0.8);
}

.nav-tree .nav-link.active:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateX(4px);
}

/* 图标样式 */
.nav-tree .nav-link i {
  width: 16px;
  text-align: center;
  opacity: 0.8;
}

.nav-tree .nav-link.active i {
  opacity: 1;
}

/* 分类间距 */
.nav-category:not(:last-child) {
  margin-bottom: 1.5rem;
}

/* 滚动条样式优化 */
.help-sidebar::-webkit-scrollbar {
  width: 4px;
}

.help-sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

.help-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.help-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* 右侧内容区域 */
.help-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  max-width: calc(100% - 300px);
}

/* 视频区域 */
.video-section {
  margin-bottom: 3rem;
}

.video-container {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  background: #000;
}

.video-container video {
  border-radius: 12px;
  max-height: 400px;
  object-fit: contain;
}

.video-info h4 {
  color: #1e293b;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* 文档区域 */
.doc-section {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.doc-header {
  padding: 1.5rem 2rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.doc-header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.breadcrumb {
  margin-bottom: 0;
  background: none;
  padding: 0;
}

.breadcrumb-item a {
  color: #6366f1;
}

.doc-content {
  padding: 2rem;
}

/* Markdown内容样式 */
.markdown-content {
  line-height: 1.7;
  color: #374151;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
  color: #1f2937;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.markdown-content h1 {
  font-size: 2rem;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0.5rem;
}

.markdown-content h2 {
  font-size: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.3rem;
}

.markdown-content h3 {
  font-size: 1.25rem;
}

.markdown-content p {
  margin-bottom: 1rem;
}

.markdown-content ul,
.markdown-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.markdown-content li {
  margin-bottom: 0.5rem;
}

.markdown-content blockquote {
  border-left: 4px solid #6366f1;
  background: #f8fafc;
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 8px 8px 0;
}

.markdown-content code {
  background: #f1f5f9;
  color: #e11d48;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.markdown-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.markdown-content pre code {
  background: none;
  color: inherit;
  padding: 0;
}

.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.markdown-content th,
.markdown-content td {
  border: 1px solid #e5e7eb;
  padding: 0.75rem;
  text-align: left;
}

.markdown-content th {
  background: #f9fafb;
  font-weight: 600;
}

.markdown-content a {
  color: #6366f1;
  text-decoration: none;
}

.markdown-content a:hover {
  text-decoration: underline;
}

/* 加载占位符 */
.loading-placeholder {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* 文档导航 */
.doc-navigation {
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
}

/* 版权信息样式 */
.help-footer {
  padding-top: 1.5rem;
  border-top: 1px solid #f1f5f9;
  margin-top: 2rem;
}

.copyright-line {
  font-size: 0.875rem;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.copyright-text {
  color: #64748b;
  font-weight: 400;
}

.separator {
  color: #cbd5e1;
  font-weight: 300;
}

.icp-link {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s ease;
  font-size: 0.875rem;
}

.icp-link:hover {
  color: #64748b;
  text-decoration: underline;
}

/* 移动端适配 */
.mobile-sidebar-toggle {
  position: fixed;
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
  z-index: 1050;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
}

.mobile-sidebar-toggle:hover {
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
  transform: translateY(-50%) scale(1.1);
}

.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* 响应式设计 */
@media (max-width: 991.98px) {
  .help-container {
    position: relative;
  }
  
  .help-sidebar {
    position: fixed;
    top: 76px;
    right: 0;
    z-index: 1045;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    height: calc(100vh - 76px);
    width: 280px;
  }

  .help-sidebar.show {
    transform: translateX(0);
  }

  /* 移动端隐藏侧边栏顶部logo和名称 */
  .help-sidebar .sidebar-header {
    display: none;
  }

  /* 移动端调整侧边栏内容区域 */
  .help-sidebar .sidebar-content {
    padding-top: 1rem;
  }
  
  .help-content {
    max-width: 100%;
    padding: 1.5rem;
  }
  
  .video-container video {
    max-height: 250px;
  }
  
  .doc-content {
    padding: 1.5rem;
  }
  
  .doc-header {
    padding: 1rem 1.5rem;
  }

  .doc-header nav {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
  }
}

@media (max-width: 576px) {
  .help-content {
    padding: 1rem;
  }
  
  .doc-content {
    padding: 1rem;
  }
  
  .doc-header {
    padding: 1rem;
  }

  .doc-header nav {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
  }
  
  .video-container video {
    max-height: 200px;
  }
  
  .markdown-content h1 {
    font-size: 1.5rem;
  }
  
  .markdown-content h2 {
    font-size: 1.25rem;
  }
  
  .markdown-content h3 {
    font-size: 1.125rem;
  }

  /* 移动端版权信息样式调整 */
  .help-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
  }

  .copyright-line {
    font-size: 0.8rem;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-end;
  }

  .separator {
    display: none;
  }

  .icp-link {
    font-size: 0.75rem;
  }
}

/* 内容区域滚动条样式 */
.help-content::-webkit-scrollbar {
  width: 6px;
}

.help-content::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.help-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.help-content::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 联系我们弹出层样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #ffffff;
    margin: 10% auto;
    padding: 0;
    border: none;
    border-radius: 1rem;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

.contact-modal {
    text-align: center;
}

.contact-modal-body {
    padding: 2rem;
}

.qr-code-image {
    width: 200px;
    height: 200px;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.contact-text {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
}

/* 更多联系方式按钮样式 */
.contact-modal .btn-outline-primary {
    border-color: #3b82f6;
    color: #3b82f6;
    background-color: transparent;
    transition: all 0.2s ease;
}

.contact-modal .btn-outline-primary:hover {
    background-color: #3b82f6;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    color: #94a3b8;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close:hover,
.close:focus {
    color: #475569;
    background-color: #f1f5f9;
    text-decoration: none;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 按钮组样式优化 */
.d-flex.gap-2 {
    gap: 0.5rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20% auto;
    }

    .qr-code-image {
        width: 180px;
        height: 180px;
    }

    .contact-modal-body {
        padding: 1.5rem;
    }

    /* 移动端按钮组保持水平排列，但减小间距 */
    .doc-header .d-flex.gap-2 {
        flex-direction: row;
        gap: 0.25rem;
    }

    .doc-header .icon-btn {
        width: 28px;
        height: 28px;
    }

    .doc-header .icon-btn i {
        font-size: 0.8rem;
    }
}
