:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --card: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.12);
  --border: #334155;
  --radius: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 17px;
}

.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Шапка --- */
.hero {
  padding: 72px 0 48px;
  background: linear-gradient(180deg, #1e293b 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.hero h1 {
  font-size: 2.1rem;
  line-height: 1.25;
  margin-bottom: 14px;
}

.subtitle {
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 28px;
}

.toc {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.toc a {
  color: var(--accent);
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  transition: background 0.2s, border-color 0.2s;
}

.toc a:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* --- Секции --- */
.section {
  padding: 44px 0;
  border-bottom: 1px solid var(--border);
}

.section:last-of-type {
  border-bottom: none;
}

h2 {
  font-size: 1.45rem;
  margin-bottom: 18px;
}

h3 {
  font-size: 1.05rem;
  margin: 20px 0 8px;
}

p {
  margin-bottom: 12px;
}

a {
  color: var(--accent);
}

/* --- Списки --- */
.checklist {
  list-style: none;
}

.checklist li {
  position: relative;
  padding: 8px 0 8px 30px;
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 8px;
  color: var(--accent);
  font-weight: 700;
}

.checklist code,
p code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 0.9em;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}

/* --- Карточки плагинов --- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 8px 0 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.card h3 {
  margin: 0 0 8px;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.note {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 12px 16px;
  color: var(--text);
  font-size: 0.95rem;
}

/* --- Блоки кода --- */
.snippet {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 10px 0 22px;
  overflow-x: auto;
}

.snippet code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92rem;
  color: #a5f3fc;
  white-space: pre;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* --- Итог --- */
.summary {
  text-align: left;
}

/* --- Подвал --- */
.footer {
  padding: 28px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

/* --- Кнопка наверх --- */
#to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent);
  font-size: 1.3rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  transform: translateY(10px);
}

#to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (max-width: 600px) {
  .hero { padding: 48px 0 36px; }
  .hero h1 { font-size: 1.6rem; }
  body { font-size: 16px; }
}