body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.7;
  color: #333;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 20px 80px;
  background-color: #fff;
  /* iOS の SFSafariViewController で開かれる想定。左右の見切れを防ぐ */
  overflow-wrap: anywhere;
}

h1 {
  color: #333;
  border-bottom: 1px solid #ddd;
  padding-bottom: 10px;
}

h2 {
  color: #333;
  margin-top: 40px;
  border-bottom: 1px solid #eee;
  padding-bottom: 6px;
}

h3 {
  margin-top: 28px;
  font-size: 1.05rem;
}

p, li {
  font-size: 0.95rem;
}

ul, ol {
  padding-left: 20px;
}

li {
  margin-bottom: 6px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: #f4f4f5;
  padding: 2px 5px;
  border-radius: 4px;
}

/* 横に長いコードは折り返さずスクロールさせる (コピーしたときに壊れないように) */
pre {
  background: #f4f4f5;
  border-radius: 10px;
  padding: 14px;
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.82rem;
  line-height: 1.6;
  white-space: pre;
}

/* AI に投げる例文。コピーして貼るコードではなく読んで伝わればいいものなので、
   横スクロールさせず折り返す (スマホ幅で右が切れると何を頼めるのか分からない) */
pre.prompt code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.9rem;
}

th, td {
  border: 1px solid #e5e5e5;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #fafafa;
  font-weight: 600;
  white-space: nowrap;
}

/* 注意書き。トークンの扱いなど、読み飛ばされると困るもの */
.note {
  background: #fff8e6;
  border-left: 4px solid #e0a800;
  border-radius: 0 8px 8px 0;
  padding: 12px 14px;
  margin: 20px 0;
  font-size: 0.9rem;
}

.method {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  background: #4a7c59;
  padding: 2px 7px;
  border-radius: 4px;
  margin-right: 6px;
}

.method.post {
  background: #2f6fb5;
}

.method.patch {
  background: #a06a1f;
}

.method.delete {
  background: #a33a3a;
}

footer {
  margin-top: 60px;
  padding-top: 16px;
  border-top: 1px solid #eee;
  font-size: 0.85rem;
  color: #888;
}

@media (prefers-color-scheme: dark) {
  body {
    color: #e6e6e6;
    background-color: #1c1c1e;
  }
  h1, h2, h3 { color: #f2f2f2; }
  h1 { border-bottom-color: #3a3a3c; }
  h2 { border-bottom-color: #2c2c2e; }
  code, pre { background: #2c2c2e; }
  th, td { border-color: #3a3a3c; }
  th { background: #262628; }
  .note { background: #33290f; border-left-color: #e0a800; }
  footer { border-top-color: #2c2c2e; color: #8e8e93; }
}
