/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans TC', sans-serif;
  color: #333;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
  min-height: 100vh;
}

a { color: #32b0ad; text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Layout === */
.help-header {
  background: #fff;
  border-bottom: 1px solid #d9d9d9;
  position: sticky;
  top: 0;
  z-index: 10;
}

.help-header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.help-header-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
}

.help-header-back {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  color: #666;
  background: none;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.help-header-back:hover {
  background: #f5f5f5;
  color: #333;
  text-decoration: none;
}

.help-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: none;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  color: #666;
}

.help-body {
  display: flex;
  max-width: 1100px;
  margin: 0 auto;
  min-height: calc(100vh - 57px);
}

/* === Sidebar === */
.help-sidebar {
  width: 220px;
  flex-shrink: 0;
  padding: 1.5rem 0;
  position: sticky;
  top: 57px;
  max-height: calc(100vh - 57px);
  overflow-y: auto;
}

.help-nav-group-title {
  padding: 0.5rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #999;
  letter-spacing: 0.05em;
}

.help-nav-item {
  display: block;
  padding: 0.5rem 1.25rem 0.5rem 1.75rem;
  font-size: 0.9rem;
  color: #666;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.help-nav-item:hover {
  background: #f5f5f5;
  color: #333;
  text-decoration: none;
}

.help-nav-item.active {
  color: #32b0ad;
  background: #e6f9fa;
  font-weight: 500;
}

/* === Content === */
.help-content {
  flex: 1;
  padding: 2rem;
  min-width: 0;
}

.help-article {
  background: #fff;
  border-radius: 8px;
  padding: 2rem 2.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.help-article h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
  margin: 0 0 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #d9d9d9;
}

.help-article h2 {
  font-size: 1.15rem;
  font-weight: 600;
  color: #333;
  margin: 2rem 0 0.75rem;
}

.help-article h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  margin: 1.5rem 0 0.5rem;
}

.help-article p {
  font-size: 0.95rem;
  color: #666;
  line-height: 1.8;
  margin: 0.75rem 0;
}

.help-article ul, .help-article ol {
  padding-left: 1.5rem;
  margin: 0.75rem 0;
}

.help-article li {
  font-size: 0.95rem;
  color: #666;
  line-height: 1.8;
  margin-bottom: 0.25rem;
}

.help-article img {
  display: block;
  max-width: 100%;
  border-radius: 6px;
  margin: 1rem 0;
}

.help-article img[style*="vertical-align:middle"] {
  display: inline;
  margin: 0;
  border-radius: 0;
}

.help-article code {
  background: #f0f0f0;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.85em;
}

.help-article pre {
  background: #f0f0f0;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1rem 0;
}

.help-article pre code {
  background: none;
  padding: 0;
}

/* === Prev/Next nav === */
.help-prevnext {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
}

.help-prevnext a {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  max-width: 45%;
}

.help-prevnext a:hover {
  border-color: #32b0ad;
  box-shadow: 0 2px 8px rgba(50, 176, 173, 0.1);
  text-decoration: none;
}

.help-prevnext-label {
  font-size: 0.75rem;
  color: #999;
}

.help-prevnext-title {
  font-size: 0.95rem;
  color: #32b0ad;
  font-weight: 500;
}

.help-prevnext .next {
  margin-left: auto;
  text-align: right;
}

/* === Mobile overlay === */
.help-sidebar-overlay {
  display: none;
}

/* === Mobile === */
@media (max-width: 520px) {
  .help-header-inner {
    padding: 0.75rem 1rem;
  }

  .help-header-title {
    font-size: 1.1rem;
  }

  .help-menu-btn {
    display: flex;
  }

  .help-body {
    min-height: auto;
  }

  .help-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 220px;
    z-index: 100;
    background: #fff;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
  }

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

  .help-sidebar-overlay.open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 99;
  }

  .help-content {
    padding: 1rem;
  }

  .help-article {
    padding: 1.25rem;
  }

  .help-article h1 {
    font-size: 1.25rem;
  }

  .help-prevnext {
    flex-direction: column;
    gap: 0.75rem;
  }

  .help-prevnext a {
    max-width: 100%;
  }
}

/* === Index page === */
.help-index-list {
  list-style: none;
  padding: 0;
}

.help-index-item {
  margin-bottom: 1rem;
}

.help-index-item a {
  display: block;
  padding: 1.25rem 1.5rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  text-decoration: none;
  transition: box-shadow 0.15s, transform 0.15s;
}

.help-index-item a:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
  text-decoration: none;
}

.help-index-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.25rem;
}

.help-index-desc {
  font-size: 0.9rem;
  color: #666;
}
