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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #1a1a1a;
  background: #f8f9fa;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

a.ac::after { content: attr(href); }

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: 8px 16px;
  background: #fff;
  color: #2563eb;
  border: 2px solid #2563eb;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
}
.skip-link:focus { left: 16px; top: 16px; }

/* ---- Site header ---- */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.site-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: #1a1a1a;
  text-decoration: none;
  letter-spacing: -0.02em;
}
.site-name:hover { color: #2563eb; text-decoration: none; }

.site-nav { display: flex; gap: 24px; }
.site-nav a {
  color: #6b7280;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s;
}
.site-nav a:hover { color: #2563eb; text-decoration: none; }

/* ---- Layout ---- */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---- Page hero ---- */
.page-hero {
  text-align: center;
  padding: 48px 16px 40px;
}

.page-hero h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #111;
  margin-bottom: 8px;
}

.page-hero p {
  font-size: 1.05rem;
  color: #6b7280;
}

/* ---- Table of contents ---- */
.toc { margin-bottom: 32px; }

.toc-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  font-weight: 600;
  margin-bottom: 12px;
}

.toc ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toc a {
  display: inline-block;
  padding: 6px 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  color: #374151;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.15s;
}
.toc a:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: #eff6ff;
  text-decoration: none;
}

/* ---- Content sections (cards) ---- */
.section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 28px 32px;
  margin-bottom: 16px;
}

.section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #111;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.section h3 {
  font-size: 0.92rem;
  font-weight: 600;
  color: #374151;
  margin: 20px 0 10px;
}

/* ---- Directory link lists ---- */
.links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.links li {
  padding: 7px 0;
  font-size: 0.9rem;
  border-bottom: 1px solid #f3f4f6;
  line-height: 1.55;
  word-break: break-word;
}
.links li:last-child { border-bottom: none; }

.note-text {
  font-size: 0.85rem;
  color: #6b7280;
  font-style: italic;
  margin-top: 12px;
  line-height: 1.5;
}

.section .intro {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 14px;
}

/* ---- Guide cards ---- */
.guide-card {
  display: block;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px 28px;
  color: #1a1a1a;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.guide-card:hover {
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
  text-decoration: none;
}

.guide-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #2563eb;
  margin: 0 0 8px;
}

.guide-card p {
  font-size: 0.88rem;
  color: #6b7280;
  line-height: 1.55;
  margin: 0;
}

/* ---- Breadcrumb ---- */
.breadcrumb {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-bottom: 24px;
}
.breadcrumb a { color: #9ca3af; font-weight: 500; }
.breadcrumb a:hover { color: #2563eb; }

/* ---- Callout box ---- */
.callout {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-left: 3px solid #2563eb;
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  font-size: 0.9rem;
  margin: 24px 0;
  color: #374151;
  line-height: 1.55;
}

/* ---- Article ---- */
article { line-height: 1.75; }

article h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #111;
  margin-bottom: 6px;
}

article .byline {
  font-size: 0.88rem;
  color: #9ca3af;
  margin-bottom: 32px;
}

article h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 40px 0 16px;
  padding-top: 28px;
  border-top: 1px solid #f3f4f6;
  color: #111;
}
article h2:first-of-type { border-top: none; padding-top: 0; }

article h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 28px 0 12px;
  color: #374151;
}

article p { margin-bottom: 14px; color: #374151; }

article ul, article ol {
  margin: 14px 0;
  padding-left: 24px;
  color: #374151;
}
article li { margin: 5px 0; }

article code {
  background: #f3f4f6;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.88em;
  font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
  color: #1a1a1a;
}

article img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 24px auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

article .caption {
  text-align: center;
  font-size: 0.82rem;
  color: #9ca3af;
  font-style: italic;
  margin: -14px 0 28px;
}

/* ---- Footer ---- */
footer {
  margin-top: 48px;
  padding: 32px 16px;
  border-top: 1px solid #e5e7eb;
  text-align: center;
  font-size: 0.82rem;
  color: #9ca3af;
  background: #fff;
}
footer p { margin-bottom: 6px; }
footer a { color: #9ca3af; }
footer a:hover { color: #2563eb; }

/* ---- Error page ---- */
.error-page {
  text-align: center;
  padding: 80px 16px;
}
.error-page h1 {
  font-size: 1.3rem;
  margin-bottom: 12px;
  color: #111;
}
.error-page p { color: #6b7280; }

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .page-hero { padding: 32px 0 28px; }
  .page-hero h1 { font-size: 1.5rem; }
  .page-hero p { font-size: 0.95rem; }
  .section { padding: 20px; border-radius: 8px; }
  .site-header-inner { height: 48px; }
  .site-nav { gap: 16px; }
  article h1 { font-size: 1.3rem; }
  .guide-card { padding: 18px 20px; }
}
