:root {
  --primary: #fb607f;
  --primary-light: #ff9bb2;
  --secondary: #17a2b8;
  --bg: #ffffff;
  --text: #1f2430;
  --text-muted: #6b7280;
  --border: #eceef1;
  --code-bg: #f6f7f9;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Yu Gothic", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.8;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

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

/* ---- トップバー ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  box-shadow: 0 1px 12px rgba(251, 96, 127, 0.07);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
  min-width: 0;
}
.brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
  margin: 0;
  border: none;
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { font-size: 0.95rem; }
.brand-text small { font-size: 0.7rem; color: var(--text-muted); }

/* ---- ナビ（ハンバーガーメニュー） ---- */
.nav-wrap { position: relative; flex-shrink: 0; }
.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  gap: 4px;
}
.menu-toggle:hover { border-color: var(--primary); }
.menu-toggle svg { width: 20px; height: 20px; stroke: var(--text); }

.nav-drawer {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 260px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(31, 36, 48, 0.14);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
.nav-drawer.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-drawer a {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.nav-drawer a:hover { background: var(--code-bg); color: var(--primary); }

/* ---- ヒーロー ---- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  padding: 56px 24px 64px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 20px;
}
.hero-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}
.hero h1 {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 700;
  line-height: 1.35;
  text-wrap: balance;
  margin: 0 0 16px;
  max-width: 640px;
  position: relative;
  z-index: 1;
}
.hero p {
  font-size: 1rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.92);
  max-width: 620px;
  margin: 0;
  position: relative;
  z-index: 1;
}
.hero-blob {
  position: absolute;
  right: -80px;
  bottom: -120px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

/* ---- 本文 ---- */
.content {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 96px;
}

article h1, article h2, article h3, article h4 {
  font-weight: 700;
  text-wrap: balance;
}
article h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.2rem;
  line-height: 1.5;
  margin: 3rem 0 1.2rem;
}
article h2:first-child { margin-top: 0; }
.badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}
article h3 {
  font-size: 1.02rem;
  line-height: 1.5;
  margin: 1.8rem 0 0.8rem;
  color: var(--secondary);
}
article h4 { font-size: 0.95rem; margin: 1.3rem 0 0.6rem; }

article p { margin: 0.9rem 0; }

article ul, article ol {
  padding-left: 1.3rem;
  margin: 0.9rem 0;
}
article li { margin: 0.4rem 0; }
article li::marker { color: var(--text-muted); }

article img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  margin: 1.6rem auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(31, 36, 48, 0.06);
  cursor: zoom-in;
  transition: box-shadow 0.15s ease;
}
article img:hover {
  box-shadow: 0 8px 28px rgba(31, 36, 48, 0.14);
}

/* ---- 画像ライトボックス ---- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(15, 17, 23, 0.82);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s;
}
.lightbox-overlay.open { opacity: 1; visibility: visible; }
.lightbox-overlay img {
  max-width: 92vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  cursor: zoom-out;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.26); }

article table {
  display: block;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}
article th, article td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
  white-space: nowrap;
}
article th { background: var(--code-bg); font-weight: 600; }

article code {
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 5px;
  font-size: 0.9em;
}

article hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.4rem 0;
}

article strong { font-weight: 700; }

/* ---- 一覧ページ ---- */
.index-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 72px 24px 96px;
}
.index-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  margin-bottom: 20px;
}
.index-header h1 { margin: 0 0 0.6rem; font-size: 1.7rem; }
.index-header p { color: var(--text-muted); margin: 0 0 32px; }

.manual-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.manual-list a {
  display: block;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 22px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.manual-list a:hover {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 4px 16px rgba(251, 96, 127, 0.12);
}

@media (max-width: 640px) {
  .topbar { padding: 10px 16px; }
  .nav-drawer { right: -12px; min-width: 220px; }
  .hero { padding: 40px 20px 52px; }
}
