:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #5c6570;
  --border: #e2e6ea;
  --accent: #0b6bcb;
  --accent-hover: #084b8a;
  --chip: #e8f1fb;
  --chip-text: #0b6bcb;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 4px 16px rgba(16, 24, 40, 0.04);
  --max: 920px;
  --font: "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

.site-header {
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 10px rgba(16, 24, 40, 0.04);
}
.header-inner {
  max-width: calc(var(--max) + 80px);
  margin: 0 auto;
  height: 48px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 0 1 auto;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.3;
}
.brand:hover { text-decoration: none; color: var(--text); }
.brand img {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 6px;
  object-fit: cover;
}
.brand-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}
.header-button {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.header-button:hover {
  color: var(--accent);
  background: var(--bg);
}
.header-button:focus-visible,
.overlay-close:focus-visible {
  outline: 3px solid rgba(11, 107, 203, 0.24);
  outline-offset: 1px;
}
.header-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.overlay-open { overflow: hidden; }
.header-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.42);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.header-overlay.is-open {
  opacity: 1;
  visibility: visible;
}
.menu-drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: min(320px, 88vw);
  height: 100%;
  background: var(--surface);
  box-shadow: -12px 0 32px rgba(16, 24, 40, 0.16);
  transform: translateX(100%);
  transition: transform 0.24s ease;
  overflow-y: auto;
}
.menu-overlay.is-open .menu-drawer { transform: translateX(0); }
.drawer-header {
  min-height: 56px;
  padding: 8px 14px 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.drawer-header h2 {
  margin: 0;
  font-size: 1rem;
}
.overlay-close {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}
.overlay-close:hover {
  color: var(--text);
  background: var(--bg);
}
.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px;
}
.drawer-nav a {
  min-height: 42px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  border-radius: 8px;
  font-size: 0.9rem;
  text-decoration: none;
}
.drawer-nav a:hover {
  background: var(--chip);
  color: var(--accent);
  text-decoration: none;
}
.drawer-nav a.active {
  background: var(--chip);
  color: var(--accent-hover);
  font-weight: 700;
}
.drawer-count {
  min-width: 24px;
  padding: 1px 7px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.74rem;
  text-align: center;
}
.drawer-divider {
  height: 1px;
  margin: 7px 10px;
  background: var(--border);
}
.search-overlay {
  padding: 68px 20px 20px;
}
.search-panel {
  width: min(620px, 100%);
  margin: 0 auto;
  padding: 14px;
  display: flex;
  gap: 8px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(16, 24, 40, 0.2);
  transform: translateY(-12px);
  transition: transform 0.2s ease;
}
.search-overlay.is-open .search-panel { transform: translateY(0); }
.overlay-search-form {
  min-width: 0;
  flex: 1;
  display: flex;
  gap: 8px;
}
.overlay-search-form input {
  min-width: 0;
  flex: 1;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  outline: none;
}
.overlay-search-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 107, 203, 0.14);
}
.overlay-search-form button {
  padding: 9px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.overlay-search-form button:hover {
  background: var(--accent-hover);
}

main {
  flex: 1;
  max-width: calc(var(--max) + 80px);
  width: 100%;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.hero {
  background: linear-gradient(145deg, #0b6bcb 0%, #084b8a 100%);
  color: #fff;
  border-radius: calc(var(--radius) + 4px);
  padding: 36px 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}
.hero h1 {
  margin: 0 0 8px;
  font-size: 1.75rem;
  line-height: 1.35;
}
.hero p {
  margin: 0;
  opacity: 0.92;
  font-size: 1rem;
}

.section-title {
  font-size: 1.1rem;
  margin: 0 0 14px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.article-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, transform 0.15s;
}
.article-card:hover {
  border-color: #c5d8ef;
  transform: translateY(-1px);
}
.article-card a.card-link {
  color: inherit;
  text-decoration: none;
  display: block;
}
.article-card a.card-link:hover { text-decoration: none; }
.article-card h2 {
  margin: 0 0 8px;
  font-size: 1.12rem;
  line-height: 1.4;
  color: var(--text);
}
.article-card:hover h2 { color: var(--accent); }
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.excerpt {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.breadcrumb {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb span { margin: 0 6px; color: #b0b7bf; }

.article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 28px 36px;
  box-shadow: var(--shadow);
}
.article header h1 {
  margin: 0 0 12px;
  font-size: 1.65rem;
  line-height: 1.35;
}
.article .content {
  margin-top: 22px;
  font-size: 1.02rem;
}
.article .content > *:first-child { margin-top: 0; }
.article .content h1,
.article .content h2,
.article .content h3,
.article .content h4 {
  margin-top: 1.6em;
  margin-bottom: 0.5em;
  line-height: 1.35;
}
.article .content p { margin: 0 0 1em; }
.article .content ul,
.article .content ol { margin: 0 0 1em; padding-left: 1.4em; }
.article .content li { margin: 0.25em 0; }
.article .content a { word-break: break-all; }
.article .content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.article .content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1em;
  font-size: 0.95rem;
}
.article .content th,
.article .content td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}
.article .content blockquote {
  margin: 0 0 1em;
  padding: 8px 16px;
  border-left: 4px solid var(--accent);
  background: #f0f6fc;
  color: #333;
}
.article .content pre,
.article .content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}
.article .content pre {
  background: #1e2430;
  color: #e8ecf1;
  padding: 14px 16px;
  border-radius: 8px;
  overflow-x: auto;
}

.empty {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.88rem;
  padding: 22px 20px;
  text-align: center;
}
.site-footer a { color: var(--muted); }

.not-found {
  text-align: center;
  padding: 60px 20px;
}
.not-found h1 { font-size: 1.5rem; margin-bottom: 8px; }
.not-found p { color: var(--muted); }

@media (max-width: 720px) {
  .hero { padding: 28px 20px; }
  .hero h1 { font-size: 1.4rem; }
  .article { padding: 20px 16px 28px; }
  .article header h1 { font-size: 1.35rem; }
  .header-inner {
    height: 46px;
    gap: 10px;
    padding: 0 10px 0 12px;
  }
  .brand { font-size: 0.82rem; }
  .brand img {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
  }
  .header-button {
    width: 36px;
    height: 36px;
  }
  .search-overlay { padding: 58px 10px 10px; }
  .search-panel { padding: 9px; }
  .overlay-search-form { gap: 6px; }
  .overlay-search-form input { padding: 8px 10px; }
  .overlay-search-form button { padding: 8px 12px; }
}
.footer-sep {
  margin: 0 8px;
  color: #c0c6cc;
}

@media (prefers-reduced-motion: reduce) {
  .header-overlay,
  .menu-drawer,
  .search-panel {
    transition: none;
  }
}
