:root {
  color-scheme: light;
  --bg: #edf3fb;
  --paper: rgba(255, 255, 255, 0.92);
  --paper-strong: rgba(255, 255, 255, 0.98);
  --line: rgba(148, 163, 184, 0.22);
  --text: #203146;
  --muted: #6f839b;
  --title: #16324e;
  --accent: #2f6ed9;
  --accent-soft: rgba(59, 130, 246, 0.12);
  --article-link: #2563eb;
  --article-link-hover: #7c3aed;
  --shadow: 0 22px 50px rgba(34, 60, 92, 0.12);
}

html[data-skin="amber"] {
  --bg: #f3ecdd;
  --paper: rgba(255, 249, 238, 0.92);
  --paper-strong: rgba(255, 252, 246, 0.98);
  --line: rgba(168, 132, 74, 0.2);
  --text: #433425;
  --muted: #8b7760;
  --title: #322416;
  --accent: #a86e24;
  --accent-soft: rgba(214, 160, 82, 0.15);
  --article-link: #9a5b13;
  --article-link-hover: #b45309;
  --shadow: 0 22px 48px rgba(109, 76, 33, 0.12);
}

html[data-skin="graphite"] {
  color-scheme: dark;
  --bg: #0f141b;
  --paper: rgba(20, 28, 39, 0.9);
  --paper-strong: rgba(23, 32, 45, 0.98);
  --line: rgba(120, 143, 170, 0.18);
  --text: #d8e1ed;
  --muted: #8e9daf;
  --title: #eef4fb;
  --accent: #7fb3ff;
  --accent-soft: rgba(96, 165, 250, 0.16);
  --article-link: #93c5fd;
  --article-link-hover: #c4b5fd;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "SF Pro Display", "PingFang SC", "Helvetica Neue", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(125, 174, 255, 0.18), transparent 34%),
    radial-gradient(circle at top right, rgba(163, 200, 255, 0.16), transparent 28%),
    linear-gradient(180deg, #f6f9fd 0%, var(--bg) 100%);
}

.help-shell {
  width: min(1120px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 30px 0 44px;
}

.help-frame {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--paper-strong);
  box-shadow: var(--shadow);
}

.help-hero { padding: 28px 30px 24px; }
.help-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 10px; }

.help-brand {
  color: var(--title);
  font-size: 1.14rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-decoration: none;
}

.skin-switcher {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.skin-btn {
  min-height: 0;
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.skin-btn.is-active { color: var(--accent); background: var(--accent-soft); }

.help-hero h1 {
  margin: 18px 0 10px;
  color: var(--title);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.help-lead { max-width: 760px; margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.8; }
.help-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); }

.help-sidebar {
  padding: 22px 18px 18px;
  border-right: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.05);
}

.help-sidebar h2 { margin: 0 0 12px; color: var(--title); font-size: 0.9rem; font-weight: 600; }
.help-nav-group + .help-nav-group { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

.help-nav-title {
  display: block;
  width: 100%;
  margin: 0 0 6px;
  padding: 0;
  border: 0;
  color: var(--title);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
}

a.help-nav-title:hover { color: var(--accent); }
.help-nav-group.is-active .help-nav-title { color: var(--accent); }
.help-nav-items { display: none; gap: 1px; padding-left: 2px; }
.help-nav-group.is-active .help-nav-items { display: grid; }

.help-nav-item {
  position: relative;
  display: block;
  padding: 5px 10px 5px 20px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.help-nav-item::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 8px;
  width: 5px;
  height: 5px;
  margin-top: -2.5px;
  border-radius: 50%;
  background: rgba(111, 131, 155, 0.55);
}

.help-content { padding: 26px 30px 34px; }
.help-content h2 { margin: 0 0 14px; color: var(--title); font-size: 1.08rem; }
.help-content h3 { margin: 24px 0 8px; color: var(--title); font-size: 0.98rem; scroll-margin-top: 24px; }
.help-content p, .help-content li { color: var(--muted); font-size: 0.95rem; line-height: 1.9; }
.help-content ul, .help-content ol { padding-left: 1.4em; }
.help-content li + li { margin-top: 6px; }
.help-content a { color: var(--accent); text-underline-offset: 3px; }

.help-content .article-link {
  color: var(--article-link);
  text-decoration: none;
  transition: color 160ms ease;
}

.help-content .article-link:hover,
.help-content .article-link:focus-visible {
  color: var(--article-link-hover);
}

.example-box {
  position: relative;
  margin: 10px 0 14px;
  padding: 12px 44px 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 14px;
  background: rgba(148, 163, 184, 0.08);
}

.copy-btn {
  position: absolute;
  top: 9px;
  right: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.copy-btn:hover { color: var(--accent); border-color: rgba(96, 165, 250, 0.26); background: var(--accent-soft); }
pre { margin: 0; color: var(--text); font-family: "SFMono-Regular", "Menlo", monospace; font-size: 0.84rem; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
code { font-family: "SFMono-Regular", "Menlo", monospace; }

.help-tip {
  margin-top: 22px;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  background: var(--accent-soft);
}

.help-tip strong { color: var(--title); }
.help-tip p { margin: 6px 0 0; }

.lesson-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.lesson-card { display: block; padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: 20px; color: inherit; background: rgba(148, 163, 184, 0.06); text-decoration: none; }
.lesson-card strong { display: block; margin-bottom: 6px; color: var(--title); font-size: 0.98rem; }
.lesson-card span { color: var(--muted); font-size: 0.88rem; line-height: 1.75; }
.lesson-card:hover { border-color: rgba(96, 165, 250, 0.2); background: var(--accent-soft); }

@media (max-width: 900px) {
  .help-shell { width: min(100vw - 24px, 1120px); padding-top: 20px; }
  .help-hero-top { flex-direction: column; align-items: flex-start; }
  .help-layout { grid-template-columns: 1fr; }
  .help-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .lesson-grid { grid-template-columns: 1fr; }
  .help-content { padding: 22px; }
}
