:root {
  --bg: #ffffff;
  --bg-sidebar: #f7f8fa;
  --bg-code: #f4f5f7;
  --bg-callout: #fff8e1;
  --border: #e4e7eb;
  --border-strong: #cbd2d9;
  --text: #1f2933;
  --text-secondary: #52606d;
  --text-muted: #7b8794;
  --accent: #2c5282;
  --accent-light: #e8f0fb;
  --warning: #b45309;
  --warning-bg: #fffbeb;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 32px 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar .brand {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.sidebar .site-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 32px 0;
  line-height: 1.4;
}

.sidebar nav {
  font-size: 14px;
}

.sidebar nav .nav-group {
  margin-bottom: 24px;
}

.sidebar nav .nav-group-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.sidebar nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar nav li {
  margin-bottom: 4px;
}

.sidebar nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-weight: 400;
  transition: background-color 0.15s, color 0.15s;
}

.sidebar nav a:hover {
  background: var(--accent-light);
  color: var(--accent);
  text-decoration: none;
}

.sidebar nav a.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 500;
}

.content {
  padding: 48px 64px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.breadcrumb a {
  color: var(--text-muted);
}

.page-meta {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  padding: 16px 20px;
  margin-bottom: 32px;
  border-radius: 4px;
  font-size: 14px;
  color: var(--text-secondary);
}

.page-meta dl {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
}

.page-meta dt {
  font-weight: 600;
  color: var(--text);
}

.page-meta dd {
  margin: 0;
}

h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 24px 0;
  line-height: 1.3;
  color: var(--text);
}

h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 56px 0 16px 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  line-height: 1.4;
  color: var(--text);
}

h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 32px;
}

h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 32px 0 12px 0;
  color: var(--text);
}

p {
  margin: 12px 0;
}

img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: block;
  margin: 16px 0;
}

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

li {
  margin: 6px 0;
}

code {
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  color: var(--text);
}

pre {
  background: var(--bg-code);
  padding: 16px 20px;
  border-radius: 6px;
  overflow-x: auto;
  border: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.6;
}

pre code {
  background: transparent;
  padding: 0;
}

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

.callout {
  background: var(--bg-callout);
  border-left: 3px solid #f59e0b;
  padding: 16px 20px;
  border-radius: 4px;
  margin: 16px 0;
}

.callout.info {
  background: var(--accent-light);
  border-left-color: var(--accent);
}

.callout.warning {
  background: var(--warning-bg);
  border-left-color: var(--warning);
}

.callout p:first-child {
  margin-top: 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-title {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.step {
  margin: 24px 0;
}

.step-number {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-weight: 600;
  font-size: 14px;
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  border-radius: 50%;
  margin-right: 8px;
}

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

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

th {
  background: var(--bg-sidebar);
  font-weight: 600;
}

.next-prev {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 64px 0 32px 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.next-prev a {
  display: block;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s;
}

.next-prev a:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.next-prev .label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.next-prev .title {
  font-weight: 500;
  color: var(--text);
}

.next-prev .prev {
  text-align: left;
}

.next-prev .next {
  text-align: right;
  grid-column: 2;
}

footer.site-footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 32px 0;
}

.card {
  display: block;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s, transform 0.15s;
  color: var(--text);
}

.card:hover {
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-2px);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--text);
}

.card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}

.hero {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: 36px;
  margin-bottom: 12px;
}

.hero .lead {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.7;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 20px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .content {
    padding: 32px 20px;
  }
  h1 {
    font-size: 26px;
  }
  h2 {
    font-size: 20px;
  }
}
