:root {
  --green: #22a45a;
  --green-dark: #1b8a4a;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --navy: #1e3a5f;
  --red: #dc3545;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f3f4f6;
  --white: #ffffff;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}
button, a { font-family: inherit; }
img { max-width: 100%; height: auto; display: block; }

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}
.top-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -1px;
  color: #1a6bb5;
  background: none;
  border: 0;
  cursor: pointer;
}
.logo span { color: var(--green); }
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.nav button, .menu-btn {
  background: none;
  border: 0;
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
}
.nav button.active, .nav button:hover {
  background: #dbeafe;
  color: var(--blue-dark);
}
.menu-btn { display: none; font-size: 22px; }

.hero {
  background: linear-gradient(135deg, #0f766e, #2563eb);
  color: white;
  padding: 48px 16px 40px;
}
.hero-inner { max-width: 1100px; margin: 0 auto; }
.hero h1 { margin: 0 0 10px; font-size: clamp(26px, 4vw, 38px); }
.hero p { margin: 0; max-width: 720px; opacity: 0.95; font-size: 17px; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 28px 16px 64px; }
.toc, .step {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 24px;
}
.toc h2, .step h2 { margin: 0 0 12px; color: var(--navy); }
.step { scroll-margin-top: 72px; padding: 28px; }
.step h2 { font-size: 24px; margin-bottom: 8px; }
.step h3 { color: var(--navy); margin: 22px 0 10px; }

.goal, .note, .flow {
  padding: 12px 14px;
  border-radius: 10px;
  margin: 12px 0 18px;
}
.goal { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; }
.note { background: #fefce8; border: 1px solid #fde68a; color: #854d0e; }
.flow {
  background: #f8fafc;
  border-left: 4px solid var(--green);
  border-radius: 0 10px 10px 0;
  font-weight: 600;
  color: var(--navy);
}

.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin: 6px 0; }
.toc button {
  background: none;
  border: 0;
  color: var(--blue);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-align: left;
}
.toc button:hover { text-decoration: underline; }

.shot {
  margin: 16px 0 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fafafa;
}
.shot button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.shot img { width: 100%; }
.shot figcaption {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--white);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 20px;
  font-size: 14px;
}
th, td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
th { background: #f8fafc; color: var(--navy); }
.yes { color: var(--green); font-weight: 700; }
.no { color: var(--muted); }
.plain { padding-left: 20px; }

.pill {
  display: inline-block;
  background: #dbeafe;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}
.pager button {
  background: var(--blue);
  color: white;
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
}
.pager button:disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
}
.pager .ghost {
  background: white;
  color: var(--blue);
  border: 1px solid var(--blue);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.82);
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}
.lightbox img {
  max-width: min(1100px, 96vw);
  max-height: 88vh;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.lightbox .close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: white;
  border: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
}

footer.site {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 24px 16px 40px;
}

@media (max-width: 800px) {
  .nav { display: none; }
  .nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 58px;
    right: 12px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    box-shadow: var(--shadow);
  }
  .menu-btn { display: inline-flex; }
  .step { padding: 18px; }
}
