:root {
  color-scheme: light;
  --page-background: #f4f6f8;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --text-primary: #1d2939;
  --text-secondary: #667085;
  --border: #d0d5dd;
  --accent: #e8751a;
  --accent-soft: #fff4e8;
  --link: #175cd3;
  --notice: #fffaeb;
  --notice-border: #fec84b;
  --shadow: 0 8px 28px rgb(16 24 40 / 8%);
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--page-background);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.page-shell {
  width: min(100% - 32px, 840px);
  margin: 40px auto;
}

.article {
  padding: clamp(24px, 5vw, 56px);
  background: var(--surface);
  border: 1px solid #eaecf0;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.article-header {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.article-header h1 {
  margin: 0;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.article-date {
  margin: 12px 0 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.content-notice {
  margin: 28px 0 36px;
  padding: 16px 20px;
  background: var(--notice);
  border-left: 4px solid var(--notice-border);
  border-radius: 8px;
  color: #7a2e0e;
  font-size: 0.9rem;
}

.content-notice p {
  margin: 0;
}

.content-notice p + p {
  margin-top: 8px;
}

.article-content > :first-child {
  margin-top: 0;
}

.article-content p,
.article-content ul,
.article-content ol,
.article-content blockquote {
  margin-top: 1em;
  margin-bottom: 1em;
}

.article-content h2,
.article-content h3 {
  scroll-margin-top: 20px;
}

.article-content h2 {
  margin: 2.8em 0 1em;
  padding: 0.45em 0 0.45em 0.8em;
  border-left: 5px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 8px 8px 0;
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  line-height: 1.5;
}

.article-content h3 {
  margin: 2.2em 0 0.8em;
  padding-bottom: 0.35em;
  border-bottom: 2px solid var(--border);
  font-size: clamp(1.15rem, 2.6vw, 1.35rem);
  line-height: 1.55;
}

.article-content a {
  color: var(--link);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.article-content a:hover {
  text-decoration-thickness: 0.14em;
}

.article-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 24px auto;
  border-radius: 10px;
}

.article-content ul,
.article-content ol {
  padding-left: 1.5em;
}

.article-content li + li {
  margin-top: 0.45em;
}

.article-content blockquote {
  padding: 8px 20px;
  border-left: 4px solid var(--border);
  color: var(--text-secondary);
}

.toc {
  margin: 32px 0;
  padding: 14px 18px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.toc summary {
  cursor: pointer;
  font-weight: 700;
}

.toc ol {
  margin: 14px 0 4px;
}

.toc-level-3 {
  margin-left: 1em;
  font-size: 0.94rem;
}

.voice {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin: 24px 0;
}

.voice.r {
  grid-template-columns: minmax(0, 1fr) 72px;
}

.voice.r .icon {
  order: 2;
}

.voice.r .voicecomment {
  order: 1;
  background: var(--accent-soft);
}

.voice .icon {
  margin: 0;
  text-align: center;
}

.voice .icon img {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 50%;
  object-fit: cover;
}

.voice .name {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 0.72rem;
  line-height: 1.4;
}

.voicecomment {
  position: relative;
  padding: 14px 16px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.references {
  margin-top: 48px;
  padding: 20px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.references h2 {
  margin-top: 0;
  background: transparent;
}

.article-content table {
  display: block;
  width: 100%;
  margin: 24px 0;
  border-collapse: collapse;
  overflow-x: auto;
}

.article-content th,
.article-content td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.article-content th {
  background: var(--surface-subtle);
}

@media (max-width: 600px) {
  .page-shell {
    width: 100%;
    margin: 0;
  }

  .article {
    padding: 24px 18px 40px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .voice,
  .voice.r {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px;
  }

  .voice.r .icon,
  .voice.r .voicecomment {
    order: initial;
  }

  .voice .icon img {
    width: 48px;
    height: 48px;
  }

  .voicecomment {
    padding: 12px 14px;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .page-shell {
    width: 100%;
    margin: 0;
  }

  .article {
    padding: 0;
    border: 0;
    box-shadow: none;
  }
}
