:root {
  --bg: #0c1210;
  --bg2: #141f1a;
  --card: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.1);
  --text: #e8f0ec;
  --muted: #8fa89a;
  --accent: #3dd68c;
  --accent-dim: #2a8f5e;
  --hero-glow: rgba(61, 214, 140, 0.25);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Noto Sans SC", "DM Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.65;
}
.bg-pattern {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--hero-glow), transparent),
    radial-gradient(circle at 100% 0%, rgba(42, 143, 94, 0.12), transparent 45%),
    radial-gradient(circle at 0% 100%, rgba(61, 214, 140, 0.08), transparent 40%);
  pointer-events: none;
  z-index: 0;
}
.site-nav {
  position: relative;
  z-index: 2;
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.site-nav a:hover, .site-nav a.active { color: var(--accent); }
.site-nav-brand { font-weight: 700; color: var(--text); }
main {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem 6rem;
}
header.hero { text-align: center; margin-bottom: 2.5rem; }
.logo-mark {
  width: 56px; height: 56px;
  margin: 0 auto 1.25rem;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--accent), var(--accent-dim));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem;
  box-shadow: 0 12px 40px rgba(61, 214, 140, 0.35);
}
h1 {
  font-size: clamp(1.85rem, 5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.tagline { color: var(--muted); font-size: 1.05rem; max-width: 40rem; margin: 0 auto 0.75rem; }
.intro {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 42rem;
  margin: 0 auto;
}
section { margin-bottom: 2.5rem; }
h2.section-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 1rem;
}
.features {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.feature {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.35rem;
  transition: border-color 0.2s, transform 0.2s;
}
.feature:hover {
  border-color: rgba(61, 214, 140, 0.35);
  transform: translateY(-2px);
}
.feature h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.feature p { color: var(--muted); font-size: 0.9rem; }
.cta-row { text-align: center; margin-top: 1.5rem; }
.btn-primary {
  display: inline-block;
  background: linear-gradient(145deg, var(--accent), var(--accent-dim));
  color: #0c1210;
  font-weight: 600;
  padding: 0.65rem 1.35rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.95rem;
}
.btn-primary:hover { filter: brightness(1.05); }
footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  text-align: center;
  padding: 1rem 1rem 1.25rem;
  font-size: 0.8rem;
  color: var(--muted);
  background: linear-gradient(to top, var(--bg), transparent);
  z-index: 2;
}
footer a { color: var(--muted); text-decoration: none; border-bottom: 1px solid rgba(143, 168, 154, 0.4); }
footer a:hover { color: var(--accent); }
footer .footer-sep { margin: 0 0.65rem; color: var(--border); }

/* Help page */
.help-shell { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem 3rem; }
.help-layout { display: grid; gap: 1.75rem; }
@media (min-width: 768px) {
  .help-layout { grid-template-columns: 240px 1fr; align-items: start; gap: 2rem; }
}
.help-main { min-width: 0; }
.help-toc {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
}
.help-toc-desktop-title {
  font-size: 0.8rem;
  color: var(--accent);
  margin: 0 0 0.75rem;
  letter-spacing: 0.08em;
}
.help-toc-panel { margin: 0; }
.help-toc-panel > summary { list-style: none; }
.help-toc-panel > summary::-webkit-details-marker { display: none; }
.help-toc-mobile-title {
  display: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  padding: 0.35rem 0;
  user-select: none;
}
.help-toc-mobile-title::after {
  content: "展开";
  float: right;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}
.help-toc-panel[open] > .help-toc-mobile-title::after { content: "收起"; }
@media (min-width: 768px) {
  .help-toc {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
  }
  .help-toc-desktop-title { display: block; }
  .help-toc-mobile-title { display: none !important; }
  .help-toc-panel > summary { display: none; }
}
@media (max-width: 767px) {
  .help-layout {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }
  .help-toc {
    order: 0;
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0.75rem 1rem;
  }
  .help-main { order: 1; }
  .help-toc-desktop-title { display: none; }
  .help-toc-mobile-title { display: block; }
  .help-toc-panel nav {
    margin-top: 0.65rem;
    max-height: min(50vh, 320px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}
.help-toc nav { display: flex; flex-direction: column; gap: 0.15rem; }
.help-toc a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
  padding: 0.4rem 0.35rem;
  border-radius: 8px;
  line-height: 1.35;
}
.help-toc a:hover { color: var(--accent); background: rgba(143, 168, 154, 0.08); }
.help-toc a.is-active {
  color: var(--accent);
  font-weight: 600;
  background: rgba(143, 168, 154, 0.12);
}
.help-toc-group { margin-top: 0.65rem; }
.help-toc-group:first-child { margin-top: 0; }
.help-toc-group-title {
  margin: 0 0 0.25rem;
  padding: 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  opacity: 0.85;
  line-height: 1.3;
}
.help-toc-group a { padding-left: 0.55rem; font-size: 0.84rem; }
.help-index-group { margin-bottom: 1.75rem; }
.help-index-group-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.65rem;
}
.help-index-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.help-index-list li { border-bottom: 1px solid var(--border); }
.help-index-list li:last-child { border-bottom: none; }
.help-index-list a {
  display: block;
  padding: 0.95rem 1.15rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
}
.help-index-list a:hover { background: rgba(143, 168, 154, 0.08); color: var(--accent); }
.help-index-group--solo .help-index-list a { font-weight: 500; }
.help-article-hero h1 { font-size: clamp(1.35rem, 4vw, 1.75rem); }
.help-article-single h1 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
  color: var(--text);
}
.help-article {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem 1.65rem;
  margin-bottom: 1.25rem;
  scroll-margin-top: 1rem;
}
.help-article h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--text);
}
.help-rich-text {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}
.help-rich-text p { margin: 0 0 0.75rem; }
.help-rich-text .ql-align-center { text-align: center; }
.help-rich-text .ql-align-right { text-align: right; }
.help-rich-text .ql-align-justify { text-align: justify; }
.help-rich-text h2, .help-rich-text h3 {
  color: var(--text);
  font-size: 1.05rem;
  margin: 1.25rem 0 0.5rem;
}
.help-rich-text ul, .help-rich-text ol {
  margin: 0 0 0.75rem 1.1rem;
  padding: 0;
}
.help-rich-text li { margin-bottom: 0.35rem; }
.help-rich-text a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(143, 168, 154, 0.35);
}
.help-rich-text a:hover { opacity: 0.9; }
.help-rich-text .help-img-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: flex-start;
  justify-content: flex-start;
  margin: 1rem 0;
}
.help-rich-text .help-img-row[data-align="center"] { justify-content: center; }
.help-rich-text .help-img-row[data-align="right"] { justify-content: flex-end; }
.help-rich-text .help-img-row img {
  margin: 0;
  flex: 0 0 auto;
}
.help-rich-text img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  margin: 1rem 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
  cursor: zoom-in;
}
.help-rich-text .help-img-row img {
  margin: 0;
}

/* Help image lightbox */
body.help-lightbox-open { overflow: hidden; }
.help-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  box-sizing: border-box;
}
.help-lightbox[hidden] { display: none !important; }
.help-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.82);
  cursor: zoom-out;
}
.help-lightbox-panel {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 1200px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
.help-lightbox-img {
  max-width: 96vw;
  max-height: calc(92vh - 2.5rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  cursor: zoom-out;
}
.help-lightbox-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
}
.help-lightbox-close:hover { background: rgba(255, 255, 255, 0.22); }
.help-lightbox-caption {
  margin: 0.65rem 0 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  text-align: center;
  max-width: 96vw;
  pointer-events: none;
}
.help-lightbox-caption[hidden] { display: none; }
.help-rich-text blockquote {
  margin: 0.75rem 0;
  padding: 0.5rem 0.85rem;
  border-left: 3px solid var(--accent);
  background: rgba(143, 168, 154, 0.08);
  border-radius: 0 8px 8px 0;
}
.help-empty { color: var(--muted); font-style: italic; }
.loading { text-align: center; color: var(--muted); padding: 3rem 1rem; }

/* Mobile — site-wide */
@media (max-width: 767px) {
  .site-nav {
    flex-wrap: wrap;
    padding: 1rem 1rem 0;
    gap: 0.65rem;
  }
  .site-nav-brand { font-size: 0.95rem; }
  .site-nav a { font-size: 0.85rem; }
  main {
    padding: 1.35rem 1rem 5.75rem;
  }
  .help-shell {
    padding: 0 1rem 5.75rem;
  }
  header.hero { margin-bottom: 1.75rem; }
  .features {
    grid-template-columns: 1fr;
  }
  footer {
    padding: 0.75rem 0.75rem max(1rem, env(safe-area-inset-bottom));
    font-size: 0.72rem;
    line-height: 1.5;
  }
  footer .footer-sep {
    display: block;
    margin: 0.25rem 0;
    visibility: hidden;
    height: 0;
  }
  footer p {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
  }
  .help-rich-text {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .help-rich-text .help-img-row {
    flex-wrap: wrap;
    justify-content: flex-start !important;
  }
  .help-article {
    padding: 1rem 1.05rem;
  }
  .help-index-list a {
    padding: 0.85rem 1rem;
  }
}
