:root {
  --accent: #6b4fbb;
  --accent-light: #efeafc;
  --text: #222;
  --text-muted: #666;
  --border: #e5e0f5;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
  line-height: 1.8;
  color: var(--text);
  margin: 0;
}

/* XREAの広告バナー挿入スペース。運営側が自動でこの直後に広告を挿入する */
.ad-space {
  width: 100%;
  text-align: center;
}

.layout {
  display: flex;
  max-width: 1080px;
  margin: 0 auto;
}

nav.toc {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 20px;
  align-self: flex-start;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 40px 16px;
  border-right: 1px solid var(--border);
}

nav.toc h2 {
  font-size: 0.85em;
  color: var(--text-muted);
  margin: 0 0 12px;
  letter-spacing: 0.05em;
}

nav.toc ul {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
}

nav.toc li {
  margin-bottom: 6px;
}

nav.toc a {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.92em;
}

nav.toc a:hover {
  background: var(--accent-light);
  color: var(--accent);
}

main {
  flex: 1;
  padding: 40px 32px 80px;
  max-width: 720px;
}

h1 {
  font-size: 1.5em;
  border-bottom: 2px solid var(--border);
  padding-bottom: 10px;
  margin-top: 0;
}

h2 {
  font-size: 1.15em;
  margin-top: 2.4em;
  padding-top: 8px;
  scroll-margin-top: 20px;
}

h3 {
  font-size: 1em;
  margin-top: 1.6em;
}

.updated {
  color: var(--text-muted);
  font-size: 0.9em;
}

ul {
  padding-left: 1.4em;
}

ol {
  padding-left: 1.4em;
}

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

a.playlink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 600;
}

a.playlink::before {
  content: "";
  display: inline-block;
  height: 1.3em;
  aspect-ratio: 5 / 1;
  background-image: url("img/play-h.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

section.doc {
  margin-bottom: 60px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

section.doc:last-child {
  border-bottom: none;
}

code {
  background: var(--accent-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

@media (max-width: 720px) {
  .layout {
    display: block;
  }

  nav.toc {
    position: static;
    width: auto;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 20px;
  }

  main {
    padding: 24px 20px 60px;
    max-width: none;
  }
}


.app-list { margin: 2em 0; }
.app-item { margin-bottom: 1.5em;}
.app-item a { font-size: 1.1em; font-weight: 600;}
.app-item p { margin: 0.2em 0 0;
  color: var(--text-muted);
  font-size: 0.9em; }