:root {
  --text: #1f2937;
  --text-muted: #6b7280;
  --bg: #ffffff;
  --border: #e5e7eb;
  --accent: #c2410c;
  --code-bg: #f3f4f6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #e5e7eb;
    --text-muted: #9ca3af;
    --bg: #0f172a;
    --border: #1f2937;
    --accent: #fb923c;
    --code-bg: #1e293b;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  color: var(--text);
  background: var(--bg);
  font-family:
    -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", "Yu Gothic Medium", Meiryo, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  font-feature-settings: "palt" 1;
  word-break: break-word;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  background: var(--bg);
}

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

.site-header .brand {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.site-header .back {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
}

h1 {
  font-size: 24px;
  line-height: 1.4;
  margin: 8px 0 8px;
  letter-spacing: 0.01em;
}

h2 {
  font-size: 18px;
  line-height: 1.5;
  margin: 40px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 16px;
  line-height: 1.5;
  margin: 28px 0 10px;
}

h4 {
  font-size: 15px;
  margin: 20px 0 8px;
}

p {
  margin: 12px 0;
}

ul,
ol {
  padding-left: 24px;
  margin: 12px 0;
}

li {
  margin: 6px 0;
}

li > ul,
li > ol {
  margin: 6px 0;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

.meta {
  color: var(--text-muted);
  font-size: 13px;
  margin: 4px 0 24px;
}

.lede {
  color: var(--text);
  margin: 16px 0 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13px;
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

table thead {
  background: var(--code-bg);
}

table th,
table td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

table th {
  font-weight: 600;
  white-space: nowrap;
}

code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

strong {
  font-weight: 700;
}

.footer {
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding-top: 16px;
  color: var(--text-muted);
  font-size: 13px;
}

.footer ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 8px 0 0;
}

.toc {
  background: var(--code-bg);
  border-radius: 8px;
  padding: 12px 16px 12px 36px;
  margin: 20px 0 32px;
  font-size: 14px;
}

.toc-title {
  font-weight: 600;
  margin: 0 0 6px;
  margin-left: -16px;
}

.notice {
  background: var(--code-bg);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  margin: 20px 0;
  border-radius: 0 6px 6px 0;
  font-size: 14px;
}

@media (min-width: 768px) {
  body {
    font-size: 16px;
  }
  h1 {
    font-size: 28px;
  }
  h2 {
    font-size: 20px;
  }
  table {
    font-size: 14px;
    white-space: normal;
    display: table;
  }
}
