:root {
  --brand: #B20784;
  --brand-dark: #8a0666;
  --brand-light: #fce4f3;
  --brand-glow: rgba(178, 7, 132, 0.12);
  --text: #1a1523;
  --text-muted: #5e5669;
  --border: #e8e4ed;
  --bg: #f7f5fa;
  --surface: #ffffff;
  --sidebar-w: 280px;
  --topbar-h: 64px;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(94, 86, 105, 0.08);
  --font: "Manrope", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 15px;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: "SF Mono", Consolas, monospace;
  font-size: 0.88em;
  background: var(--brand-light);
  color: var(--brand-dark);
  padding: 0.15em 0.45em;
  border-radius: 4px;
}

.layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform 0.25s ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.sidebar-close { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); }

.search-box { padding: 0.75rem 1rem; }

.search-box input {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}

.search-box input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.75rem 1rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}

.nav-link:hover { background: var(--brand-glow); color: var(--brand); text-decoration: none; }
.nav-link.active { background: var(--brand); color: #fff; }
.nav-link.hidden { display: none; }

.nav-icon { font-size: 1rem; width: 1.4rem; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 150;
}

/* Main */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: 0.25rem;
}

.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 1.15rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand);
  background: var(--brand-light);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.15rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
}

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); text-decoration: none; transform: translateY(-1px); }

/* Content */
.content {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.hero {
  background: linear-gradient(135deg, var(--brand) 0%, #d4149f 100%);
  color: #fff;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(178, 7, 132, 0.25);
}

.hero h2 { font-size: 1.75rem; font-weight: 800; margin-bottom: 0.5rem; }
.hero p { opacity: 0.92; font-size: 1rem; max-width: 600px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.25rem; font-size: 0.85rem; opacity: 0.85; }

.section-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  scroll-margin-top: calc(var(--topbar-h) + 1rem);
}

.section-block.hidden { display: none; }

.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--brand-light);
}

.section-header .icon { font-size: 1.5rem; }
.section-header h2 { font-size: 1.35rem; font-weight: 700; color: var(--text); }

.section-block .lead { font-size: 1.05rem; color: var(--text-muted); margin-bottom: 1rem; }
.section-block .route { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 1rem; }

.section-block h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.5rem 0 0.75rem;
  color: var(--text);
}

.section-block h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
  color: var(--text-muted);
}

.section-block p { margin-bottom: 0.75rem; }
.section-block ul, .section-block ol { margin: 0.5rem 0 1rem 1.25rem; }
.section-block li { margin-bottom: 0.35rem; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 0.75rem 0 1rem;
  overflow-x: auto;
  display: block;
}

thead { background: var(--bg); }
th, td { padding: 0.6rem 0.85rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-weight: 600; color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--brand-glow); }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.info-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-card strong { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.info-card span { font-weight: 600; font-size: 0.9rem; }

.tip, .warning {
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.tip { background: #eef9f0; border-left: 4px solid #2ea84a; }
.warning { background: #fff8e6; border-left: 4px solid #e6a817; }

.steps { counter-reset: step; list-style: none; margin-left: 0 !important; padding-left: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 0.65rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.6rem;
  height: 1.6rem;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.no-results {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

mark {
  background: #ffe066;
  padding: 0 2px;
  border-radius: 2px;
}

.screenshot {
  margin: 1.25rem 0 1.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
  box-shadow: var(--shadow);
}

.screenshot img {
  display: block;
  width: 100%;
  height: auto;
}

.screenshot figcaption {
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.screenshot-grid .screenshot { margin: 0; }

.screenshot--mobile {
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.screenshot-grid--mobile {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  justify-items: center;
}

.screenshot-grid--mobile .screenshot--mobile { width: 100%; max-width: 280px; }

.part-divider {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 1rem 0.75rem 0.35rem;
  margin-top: 0.5rem;
}

.status-matrix td:first-child { font-weight: 600; white-space: nowrap; }

.mobile-note {
  background: #f0f4ff;
  border-left: 4px solid #4a6cf7;
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin: 1rem 0;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .overlay.open { display: block; }
  .main { margin-left: 0; }
  .menu-btn { display: block; }
  .content { padding: 1.25rem 1rem 3rem; }
  .section-block { padding: 1.25rem 1rem; }
  .hero { padding: 1.75rem 1.25rem; }
  table { font-size: 0.8rem; }
}

@media print {
  .sidebar, .topbar, .overlay { display: none !important; }
  .main { margin-left: 0; }
  .section-block { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
}
