/* ===== RESET & TOKENS ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --blue: #2563EB;
  --blue-dark: #1D4ED8;
  --orange: #F97316;
  --bg-light: #F8FAFC;
  --bg-card: #FFFFFF;
  --text-dark: #1E293B;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --font-heading: 'Be Vietnam Pro', sans-serif;
  --font-body: 'Be Vietnam Pro', 'Open Sans', sans-serif;
  --topbar-h: 64px;
  --sidebar-w: 280px;
}
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--text-dark);
  background: var(--bg-light);
  line-height: 1.6;
}

/* ===== TOPBAR ===== */
.guide-topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  z-index: 100;
}
.guide-topbar .logo {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-heading); font-weight: 700; font-size: 20px;
  color: var(--text-dark); text-decoration: none;
}
.guide-topbar .logo-icon {
  width: 36px; height: 36px; background: var(--blue); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 16px;
}
.guide-topbar .hamburger {
  display: none; background: none; border: none; cursor: pointer;
  margin-right: 12px; padding: 4px;
}
.guide-topbar .hamburger svg { width: 24px; height: 24px; color: var(--text-dark); }

/* ===== SIDEBAR ===== */
.guide-sidebar {
  position: fixed; top: var(--topbar-h); left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 24px 0;
  z-index: 90;
}
.guide-sidebar h4 {
  font-family: var(--font-heading); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); padding: 0 20px; margin-bottom: 12px;
}
.guide-sidebar ul { list-style: none; }
.guide-sidebar .nav-section {
  margin-bottom: 8px;
}
.guide-sidebar .nav-section > a {
  display: block; padding: 8px 20px;
  font-weight: 600; font-size: 14px;
  color: var(--text-dark); text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 150ms ease;
}
.guide-sidebar .nav-section > a:hover,
.guide-sidebar .nav-section > a.active {
  color: var(--blue); background: rgba(37, 99, 235, 0.05);
  border-left-color: var(--blue);
}
.guide-sidebar .nav-sub { list-style: none; }
.guide-sidebar .nav-sub a {
  display: block; padding: 4px 20px 4px 36px;
  font-size: 13px; color: var(--text-muted);
  text-decoration: none; transition: color 150ms;
}
.guide-sidebar .nav-sub a:hover,
.guide-sidebar .nav-sub a.active {
  color: var(--blue);
}

/* ===== MAIN ===== */
.guide-main {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 40px 48px 80px;
  max-width: 960px;
}

/* ===== SECTION ===== */
.guide-section {
  margin-bottom: 64px;
  scroll-margin-top: calc(var(--topbar-h) + 24px);
}
.guide-section > h2 {
  font-family: var(--font-heading); font-weight: 700; font-size: 32px;
  color: var(--text-dark); margin-bottom: 8px;
}
.guide-section > .section-desc {
  font-size: 16px; color: var(--text-muted); margin-bottom: 32px;
}

/* ===== STEP ===== */
.guide-step {
  margin-bottom: 40px;
  scroll-margin-top: calc(var(--topbar-h) + 24px);
}
.guide-step .step-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.guide-step .step-number {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--blue); color: white;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.guide-step .step-title {
  font-family: var(--font-heading); font-weight: 600; font-size: 20px;
  color: var(--text-dark);
}
.guide-step .step-desc {
  font-size: 15px; color: var(--text-muted); margin-bottom: 16px;
  padding-left: 44px;
}
.guide-step .step-screenshots {
  padding-left: 44px;
  display: flex; flex-direction: column; gap: 16px;
}
.guide-step .step-screenshots img {
  width: 100%; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  cursor: zoom-in; transition: transform 150ms ease;
}
.guide-step .step-screenshots img:hover {
  transform: scale(1.01);
}
.guide-step .step-screenshots .img-caption {
  font-size: 13px; color: var(--text-muted); text-align: center;
  margin-top: -8px;
}

/* ===== INLINE ICONS ===== */
.inline-icon {
  display: inline; vertical-align: -0.125em;
  width: 1em; height: 1em; margin: 0 1px;
  color: var(--blue);
}

/* ===== TIP BOX ===== */
.tip-box {
  margin: 16px 0 16px 44px; padding: 12px 16px;
  background: rgba(37, 99, 235, 0.06);
  border-left: 3px solid var(--blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px; color: var(--text-dark);
}
.tip-box strong { color: var(--blue); }

/* ===== PAGE NAVIGATION ===== */
.page-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 48px; padding-top: 32px;
  border-top: 1px solid var(--border);
}
.page-nav a {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--border);
  text-decoration: none; color: var(--text-dark);
  font-weight: 600; font-size: 14px;
  transition: all 150ms ease;
  max-width: 45%;
}
.page-nav a:hover {
  border-color: var(--blue); color: var(--blue);
  box-shadow: var(--shadow);
}
.page-nav a svg { width: 16px; height: 16px; flex-shrink: 0; }
.page-nav .nav-label {
  font-size: 11px; font-weight: 400; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.page-nav .nav-title { display: block; }
.page-nav .nav-prev { text-align: left; }
.page-nav .nav-next { text-align: right; margin-left: auto; }

/* ===== INDEX TOC ===== */
.toc-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px; margin-top: 32px;
}
.toc-card {
  display: block; padding: 20px; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--border);
  text-decoration: none; color: var(--text-dark);
  transition: all 150ms ease;
}
.toc-card:hover {
  border-color: var(--blue); box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.toc-card .toc-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--blue); color: white;
  font-family: var(--font-heading); font-weight: 700; font-size: 13px;
  margin-bottom: 8px;
}
.toc-card .toc-title {
  font-family: var(--font-heading); font-weight: 600; font-size: 16px;
  color: var(--text-dark); margin-bottom: 4px;
}
.toc-card .toc-desc {
  font-size: 13px; color: var(--text-muted); line-height: 1.4;
}
.guide-hero {
  margin-bottom: 40px;
}
.guide-hero h1 {
  font-family: var(--font-heading); font-weight: 800; font-size: 36px;
  color: var(--text-dark); margin-bottom: 12px;
}
.guide-hero p {
  font-size: 18px; color: var(--text-muted); max-width: 600px;
}

/* ===== GUIDE INTRO (index page) ===== */
.guide-intro { margin-bottom: 8px; }
.guide-intro > p {
  font-size: 16px; color: var(--text-muted); line-height: 1.7;
  max-width: 720px; margin-bottom: 20px;
}
.guide-intro h2 {
  font-family: var(--font-heading); font-weight: 700; font-size: 22px;
  color: var(--text-dark); margin: 32px 0 12px;
}
.guide-intro h2:first-of-type { margin-top: 0; }
.guide-intro .guide-usage {
  font-size: 15px; color: var(--text-muted); line-height: 1.7;
  max-width: 720px;
}
.guide-intro .guide-usage strong { color: var(--text-dark); }
.guide-intro .pricing-note {
  display: inline-block; margin-top: 12px; padding: 8px 16px;
  background: rgba(37, 99, 235, 0.06); border-radius: var(--radius);
  font-size: 14px; color: var(--blue); font-weight: 600;
}

.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px; margin: 24px 0 32px;
}
.feature-card {
  padding: 20px; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--border);
  transition: all 150ms ease;
}
.feature-card:hover {
  border-color: var(--blue); box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.feature-card .feature-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(37, 99, 235, 0.08);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px; color: var(--blue);
}
.feature-card .feature-icon svg { width: 20px; height: 20px; }
.feature-card .feature-title {
  font-family: var(--font-heading); font-weight: 600; font-size: 15px;
  color: var(--text-dark); margin-bottom: 4px;
}
.feature-card .feature-desc {
  font-size: 13px; color: var(--text-muted); line-height: 1.5;
}

/* ===== SCROLL TO TOP ===== */
.scroll-top {
  position: fixed; bottom: 24px; right: 24px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--blue); color: white; border: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); z-index: 80;
  opacity: 0; transform: translateY(16px);
  transition: opacity 200ms ease, transform 200ms ease;
  pointer-events: none;
}
.scroll-top.visible {
  opacity: 1; transform: translateY(0); pointer-events: auto;
}
.scroll-top:hover { background: var(--blue-dark); }
.scroll-top svg { width: 20px; height: 20px; }

/* ===== IMAGE LIGHTBOX ===== */
.lightbox {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.85); z-index: 200;
  align-items: center; justify-content: center;
  padding: 24px; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%; max-height: 100%;
  border-radius: var(--radius); box-shadow: 0 0 60px rgba(0,0,0,0.4);
  object-fit: contain;
}

/* ===== MOBILE & RESPONSIVE ===== */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: 85;
}

@media (max-width: 1024px) {
  .guide-sidebar {
    transform: translateX(-100%);
    transition: transform 250ms ease;
  }
  .guide-sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open { display: block; }
  .guide-main {
    margin-left: 0;
    padding: 32px 32px 80px;
    max-width: 800px;
    margin-inline: auto;
  }
  .guide-topbar .hamburger { display: block; }
}

@media (max-width: 640px) {
  :root {
    --topbar-h: 56px;
  }
  .guide-topbar { padding: 0 16px; }
  .guide-topbar .logo { font-size: 16px; gap: 8px; }
  .guide-topbar .logo-icon { width: 32px; height: 32px; font-size: 14px; }
  .guide-main {
    padding: 20px 16px 80px;
  }
  .guide-section > h2 { font-size: 24px; }
  .guide-section > .section-desc { font-size: 14px; margin-bottom: 24px; }
  .guide-section { margin-bottom: 48px; }
  .guide-step { margin-bottom: 32px; }
  .guide-step .step-title { font-size: 17px; }
  .guide-step .step-number { width: 28px; height: 28px; font-size: 13px; }
  .guide-step .step-desc {
    font-size: 14px; padding-left: 0; margin-bottom: 12px;
  }
  .guide-step .step-screenshots {
    padding-left: 0; gap: 12px;
  }
  .guide-step .step-screenshots img {
    border-radius: 8px;
  }
  .tip-box {
    margin-left: 0; font-size: 13px; padding: 10px 12px;
  }
  .scroll-top { bottom: 16px; right: 16px; width: 40px; height: 40px; }
  .page-nav { flex-direction: column; gap: 12px; }
  .page-nav a { max-width: 100%; width: 100%; }
  .page-nav .nav-next { margin-left: 0; }
  .guide-hero h1 { font-size: 28px; }
  .guide-hero p { font-size: 15px; }
  .toc-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .guide-intro h2 { font-size: 20px; }
}

@media (max-width: 380px) {
  .guide-topbar .logo span:not(.logo-icon) { font-size: 14px; }
  .guide-section > h2 { font-size: 22px; }
  .guide-step .step-title { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .guide-sidebar, .scroll-top { transition: none; }
}

@media print {
  .guide-topbar, .guide-sidebar, .sidebar-overlay, .scroll-top, .lightbox, .page-nav { display: none !important; }
  .guide-main { margin: 0; padding: 0; max-width: 100%; }
  .guide-step .step-screenshots img { box-shadow: none; border: 1px solid #ccc; }
}
