@font-face {
    font-family: "BIZ UDPGothic";
    src: local("BIZ UDPGothic Regular"),
         local("BIZUDPGothic-Regular"),
         url(/BIZUDPGothic-Regular.woff2) format("woff2");
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "BIZ UDGothic";
    src: local("BIZ UDGothic Regular"),
         local("BIZUDGothic-Regular"),
         url(/BIZUDGothic-Regular.woff2) format("woff2");
    font-style: oblique;
    font-display: swap;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  max-width: 820px;
  margin: 0 auto;
  padding: 3rem 1.5rem 6rem;
  font-family: "BIZ UDPGothic", "BIZ UDPゴシック", sans-serif;
  font-size: 18px;
  line-height: 1.8;
  color: #1e293b;
  background-color: #fafbfc;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 2.5rem;
  margin-bottom: 0.8rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  scroll-margin-top: 2rem;
}

h1 {
  font-size: 2.6rem;
  margin-top: 0;
  padding-bottom: 0.4rem;
  border-bottom: 3px solid #e2e8f0;
  color: #0f172a;
}

h2 {
  font-size: 2rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
}

h3 {
  font-size: 1.5rem;
  color: #1e293b;
}

h4 { font-size: 1.2rem; color: #334155; }
h5 { font-size: 1.05rem; color: #475569; }
h6 { font-size: 0.95rem; color: #64748b; font-weight: 600; }

p {
  margin: 1.2rem 0;
}

p:first-child {
  margin-top: 0;
}

a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease, border-bottom 0.15s ease;
  border-bottom: 1px solid transparent;
}

a:hover {
  color: #1d4ed8;
  border-bottom-color: #1d4ed8;
}

ul, ol {
  margin: 1rem 0 1.5rem 1.8rem;
  padding-left: 0.5rem;
}

li {
  margin: 0.3rem 0;
}

li > ul, li > ol {
  margin: 0.2rem 0 0.5rem 1.5rem;
}

input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  margin-right: 0.5rem;
  accent-color: #2563eb;
  cursor: pointer;
  vertical-align: middle;
}

code {
  font-family: "BIZ UDGothic", "BIZ UDゴシック", monospace;
  font-size: 0.9em;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background: #eef2f6;
  color: #0f172a;
  white-space: nowrap;
}

pre {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  background: #0f172a;
  overflow-x: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

pre code {
  background: transparent;
  color: #e2e8f0;
  font-size: 0.85rem;
  padding: 0;
  white-space: pre;
  tab-size: 2;
}

blockquote {
  margin: 1.5rem 0;
  padding: 0.8rem 1.5rem;
  border-left: 5px solid #2563eb;
  background: #f1f5f9;
  border-radius: 0 8px 8px 0;
  color: #334155;
}

blockquote p {
  margin: 0.5rem 0;
}

blockquote p:first-child { margin-top: 0; }
blockquote p:last-child { margin-bottom: 0; }

table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  font-size: 0.95rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

th {
  background: #f1f5f9;
  font-weight: 600;
  text-align: left;
  padding: 0.7rem 1rem;
  border-bottom: 2px solid #d1d9e6;
}

td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #f8fafc;
}

hr {
  margin: 2.5rem 0;
  border: none;
  height: 2px;
  background: linear-gradient(to right, transparent, #cbd5e1, transparent);
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  margin: 1.2rem 0;
  display: block;
}

strong {
  color: #0f172a;
  font-weight: 700;
}

em {
  font-style: italic;
  color: #334155;
}

small {
  font-size: 0.85rem;
  color: #64748b;
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
    padding: 1.5rem 1rem 4rem;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
  h3 { font-size: 1.3rem; }

  pre {
    padding: 1rem;
    font-size: 0.8rem;
    border-radius: 8px;
  }

  table {
    font-size: 0.85rem;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  blockquote {
    padding: 0.6rem 1rem;
  }
}

@media (prefers-color-scheme: dark) {
  body {
    background: #0f172a;
    color: #e2e8f0;
  }

  h1, h2, h3 { color: #f1f5f9; border-bottom-color: #1e293b; }
  h4 { color: #cbd5e1; }
  h5 { color: #94a3b8; }
  h6 { color: #64748b; }

  a {
    color: #60a5fa;
  }
  a:hover {
    color: #93bbfc;
    border-bottom-color: #93bbfc;
  }

  code {
    background: #1e293b;
    color: #e2e8f0;
  }

  pre {
    background: #020617;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  }

  blockquote {
    background: #1e293b;
    border-left-color: #60a5fa;
    color: #cbd5e1;
  }

  th {
    background: #1e293b;
    border-bottom-color: #334155;
  }

  td {
    border-bottom-color: #1e293b;
  }
  tr:hover td {
    background: #1a2636;
  }

  hr {
    background: linear-gradient(to right, transparent, #334155, transparent);
  }

  strong { color: #f1f5f9; }
  em { color: #94a3b8; }
  small { color: #64748b; }

  img {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  }

  input[type="checkbox"] {
    accent-color: #60a5fa;
  }
}

button,
input[type="button"],
input[type="submit"],
input[type="reset"],
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  background: #f1f5f9;
  color: #1e293b;
}

button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover,
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
}

button:active,
input[type="button"]:active,
input[type="submit"]:active,
input[type="reset"]:active,
.btn:active {
  transform: translateY(0px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

button:focus-visible,
input[type="button"]:focus-visible,
input[type="submit"]:focus-visible,
input[type="reset"]:focus-visible,
.btn:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

button:disabled,
input[type="button"]:disabled,
input[type="submit"]:disabled,
input[type="reset"]:disabled,
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-primary,
button.primary,
input[type="submit"] {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.btn-primary:hover,
button.primary:hover,
input[type="submit"]:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.30);
}

.btn-secondary {
  background: transparent;
  color: #2563eb;
  border-color: #2563eb;
}

.btn-secondary:hover {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.20);
}

.btn-success {
  background: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
}

.btn-success:hover {
  background: #15803d;
  border-color: #15803d;
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.30);
}

.btn-danger {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.30);
}

.btn-warning {
  background: #f59e0b;
  color: #0f172a;
  border-color: #f59e0b;
}

.btn-warning:hover {
  background: #d97706;
  border-color: #d97706;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.30);
}

.btn-ghost {
  background: transparent;
  color: #1e293b;
  border-color: #d1d9e6;
}

.btn-ghost:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.btn-sm {
  padding: 0.3rem 0.9rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn-lg {
  padding: 0.8rem 2rem;
  font-size: 1.1rem;
  border-radius: 12px;
}

.btn-xl {
  padding: 1rem 2.5rem;
  font-size: 1.2rem;
  border-radius: 14px;
}

.btn-block {
  display: flex;
  width: 100%;
  justify-content: center;
}

.btn-icon {
  padding: 0.6rem 1rem;
}

.btn-icon svg {
  width: 1.2rem;
  height: 1.2rem;
  flex-shrink: 0;
}

a.btn,
a.btn-primary,
a.btn-secondary,
a.btn-success,
a.btn-danger,
a.btn-warning,
a.btn-ghost {
  text-decoration: none;
  border-bottom: none;
}

a.btn:hover,
a.btn-primary:hover,
a.btn-secondary:hover,
a.btn-success:hover,
a.btn-danger:hover,
a.btn-warning:hover,
a.btn-ghost:hover {
  border-bottom: none;
}

.nav-link {
  position: relative;
  font-weight: 500;
  color: #1e293b;
  text-decoration: none;
  border-bottom: none;
  padding: 0.3rem 0;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: #2563eb;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
  color: #2563eb;
  border-bottom: none;
}

.nav-link:hover::after {
  width: 100%;
}

.card-link {
  color: inherit;
  text-decoration: none;
  border-bottom: none;
  display: block;
  transition: all 0.2s ease;
}

.card-link:hover {
  border-bottom: none;
}

a[target="_blank"]::after {
  content: ' ↗';
  font-size: 0.8em;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

a[target="_blank"]:hover::after {
  opacity: 1;
}

@media (prefers-color-scheme: dark) {
  /* ボタン */
  button,
  input[type="button"],
  input[type="reset"],
  .btn {
    background: #1e293b;
    color: #e2e8f0;
  }

  .btn-primary,
  button.primary,
  input[type="submit"] {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
  }

  .btn-primary:hover,
  button.primary:hover,
  input[type="submit"]:hover {
    background: #2563eb;
    border-color: #2563eb;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
  }

  .btn-secondary {
    color: #60a5fa;
    border-color: #60a5fa;
  }

  .btn-secondary:hover {
    background: #3b82f6;
    color: #ffffff;
  }

  .btn-success {
    background: #22c55e;
    border-color: #22c55e;
  }

  .btn-success:hover {
    background: #16a34a;
    border-color: #16a34a;
  }

  .btn-danger {
    background: #ef4444;
    border-color: #ef4444;
  }

  .btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
  }

  .btn-warning {
    background: #fbbf24;
    border-color: #fbbf24;
    color: #0f172a;
  }

  .btn-warning:hover {
    background: #f59e0b;
    border-color: #f59e0b;
  }

  .btn-ghost {
    color: #e2e8f0;
    border-color: #334155;
  }

  .btn-ghost:hover {
    background: #1e293b;
    border-color: #64748b;
  }

  .nav-link {
    color: #e2e8f0;
  }

  .nav-link::after {
    background: #60a5fa;
  }

  .nav-link:hover {
    color: #60a5fa;
  }

  a.btn,
  a.btn-primary,
  a.btn-secondary,
  a.btn-success,
  a.btn-danger,
  a.btn-warning,
  a.btn-ghost {
    border-bottom: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  button,
  .btn,
  a,
  .nav-link::after {
    transition: none !important;
    transform: none !important;
  }

  button:hover,
  .btn:hover {
    transform: none !important;
  }
}