:root {
  --accent: #0f766e;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #667085;
  --line: #e4e4e0;
  --radius: 14px;
  --maxw: 1120px;
  --font: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111315; --surface: #1a1d20; --text: #e8e9ea; --muted: #9aa1a9; --line: #2b2f33; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.8; }
a { color: var(--accent); }
img { max-width: 100%; height: auto; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; letter-spacing: .02em; white-space: nowrap; }
.brand::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); margin-right: 8px; vertical-align: 1px; }
.nav { display: flex; gap: 4px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav a { color: var(--muted); text-decoration: none; font-size: .9rem; padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
.nav a:hover, .nav a.on { color: var(--text); background: var(--bg); }
.search-form input { border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 999px; padding: 7px 14px; width: 180px; font: inherit; font-size: .88rem; }
@media (max-width: 720px) { .search-form { display: none; } }

/* hero */
.hero { padding: 40px 0 12px; }
.hero h1 { margin: 0 0 6px; font-size: clamp(1.5rem, 3vw, 2rem); }
.hero p { margin: 0; color: var(--muted); }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; padding: 24px 0 40px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,.08); }
.card-img { position: relative; aspect-ratio: 16/9; background: linear-gradient(135deg, var(--accent), #0b3b38); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; padding: 16px; text-align: center; font-size: 1.05rem; }
.card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-size: 1.06rem; font-weight: 700; line-height: 1.55; margin: 0; }
.card-excerpt { color: var(--muted); font-size: .88rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: .8rem; flex-wrap: wrap; margin-top: auto; }
.chip { display: inline-block; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); padding: 1px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; text-decoration: none; }
.tag { color: var(--muted); text-decoration: none; font-size: .82rem; }
.tag:hover { color: var(--accent); }
.empty { padding: 60px 0; text-align: center; color: var(--muted); }

.pager { display: flex; justify-content: center; gap: 8px; padding-bottom: 48px; }
.pager a, .pager span { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--text); font-size: .9rem; }
.pager span.cur { background: var(--accent); color: #fff; border-color: var(--accent); }

/* article */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 32px; padding: 28px 0 56px; align-items: start; }
@media (max-width: 960px) { .article-layout { grid-template-columns: 1fr; } .side { display: none; } }
.article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 4vw, 48px); min-width: 0; }
.breadcrumb { font-size: .8rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.article h1.title { font-size: clamp(1.45rem, 3.2vw, 2.05rem); line-height: 1.45; margin: 0 0 14px; }
.article .cover { margin: 22px 0 8px; border-radius: 10px; overflow: hidden; }
.article .cover img { display: block; width: 100%; }
.toc { border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; margin: 28px 0; background: var(--bg); }
.toc-title { font-weight: 700; margin-bottom: 6px; }
.toc ol { margin: 0; padding-left: 1.3em; }
.toc ol ul { padding-left: 1.1em; margin: 2px 0; }
.toc ul li { font-size: .92em; list-style: circle; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--accent); }
.side .toc { position: sticky; top: 80px; background: var(--surface); margin: 0; max-height: calc(100vh - 100px); overflow: auto; font-size: .88rem; }

/* 本文 */
.prose { font-size: 1.02rem; overflow-wrap: anywhere; }
.prose h2 { font-size: 1.4rem; margin: 2.4em 0 .9em; padding: .55em .8em; background: color-mix(in srgb, var(--accent) 10%, transparent); border-left: 5px solid var(--accent); border-radius: 4px; line-height: 1.5; scroll-margin-top: 80px; }
.prose h3 { font-size: 1.18rem; margin: 2em 0 .7em; padding-bottom: .35em; border-bottom: 2px solid var(--line); scroll-margin-top: 80px; }
.prose h4 { font-size: 1.05rem; margin: 1.6em 0 .5em; }
.prose p { margin: 0 0 1.3em; }
.prose img { border-radius: 8px; display: block; margin: 1.4em auto; }
.prose figure { margin: 1.6em 0; }
.prose figcaption { text-align: center; color: var(--muted); font-size: .85rem; }
.prose blockquote { margin: 1.4em 0; padding: .8em 1.2em; border-left: 4px solid var(--line); color: var(--muted); background: var(--bg); border-radius: 0 8px 8px 0; }
.prose blockquote p:last-child { margin: 0; }
.prose ul, .prose ol { padding-left: 1.5em; margin: 0 0 1.3em; }
.prose li { margin: .25em 0; }
.prose code { background: var(--bg); border: 1px solid var(--line); padding: .1em .4em; border-radius: 5px; font-size: .9em; }
.prose pre { background: #0d1117; color: #e6edf3; padding: 16px 18px; border-radius: 10px; overflow-x: auto; font-size: .88rem; line-height: 1.6; }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; }
.prose mark { background: linear-gradient(transparent 55%, #fde68a 55%); color: inherit; padding: 0 .1em; font-weight: 600; }
@media (prefers-color-scheme: dark) { .prose mark { background: linear-gradient(transparent 55%, #8a6d0b 55%); } }
.prose strong { font-weight: 700; }
.prose hr { border: 0; border-top: 1px dashed var(--line); margin: 2.4em 0; }
.table-wrap { overflow-x: auto; margin: 1.4em 0; border: 1px solid var(--line); border-radius: 10px; }
.prose table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--bg); font-weight: 700; white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }

/* 装飾ボックス */
.box { border-radius: 12px; margin: 1.6em 0; border: 2px solid var(--bc); background: color-mix(in srgb, var(--bc) 7%, var(--surface)); overflow: hidden; }
.box-title { background: var(--bc); color: #fff; font-weight: 700; padding: 6px 14px; font-size: .92rem; display: flex; align-items: center; gap: 6px; }
.box-body { padding: 14px 18px 2px; }
.box-body > :first-child { margin-top: 0; }
.box-point { --bc: #d97706; } .box-memo { --bc: #2563eb; } .box-info { --bc: #0891b2; }
.box-warn { --bc: #dc2626; } .box-good { --bc: #16a34a; } .box-bad { --bc: #9333ea; } .box-summary { --bc: var(--accent); }
.talk { display: flex; gap: 14px; margin: 1.6em 0; align-items: flex-start; }
.talk-right { flex-direction: row-reverse; }
.talk-who { display: flex; flex-direction: column; align-items: center; width: 64px; flex-shrink: 0; }
.talk-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); margin: 0 !important; }
.talk-avatar-text { display: flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; font-weight: 700; font-size: 1.3rem; }
.talk-name { font-size: .72rem; color: var(--muted); margin-top: 2px; text-align: center; line-height: 1.3; }
.talk-bubble { position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px 0; flex: 1; min-width: 0; }
.talk-bubble > :last-child { margin-bottom: 12px; }
.details { border: 1px solid var(--line); border-radius: 10px; margin: 1.4em 0; background: var(--surface); }
.details summary { cursor: pointer; padding: 10px 16px; font-weight: 700; }
.details-body { padding: 0 16px 4px; }
.btn-cta { display: block; width: fit-content; max-width: 100%; margin: 1.6em auto; padding: 14px 36px; background: var(--accent); color: #fff !important; text-decoration: none; font-weight: 700; border-radius: 999px; box-shadow: 0 6px 0 color-mix(in srgb, var(--accent) 60%, #000); text-align: center; transition: transform .1s, box-shadow .1s; }
.btn-cta:hover { transform: translateY(2px); box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 60%, #000); }
.embed-youtube { position: relative; aspect-ratio: 16/9; margin: 1.6em 0; border-radius: 10px; overflow: hidden; }
.embed-youtube iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.article-foot { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; }
.tags { display: flex; gap: 10px; flex-wrap: wrap; }
.share { display: flex; gap: 8px; flex-wrap: wrap; }
.share a, .share button { border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 6px 14px; border-radius: 999px; font-size: .85rem; text-decoration: none; cursor: pointer; font: inherit; font-size: .85rem; }
.adjacent { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.adjacent a { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; text-decoration: none; color: var(--text); font-size: .88rem; }
.adjacent small { display: block; color: var(--muted); }
.related h2 { font-size: 1.15rem; margin: 40px 0 0; }
.related .grid { padding-top: 14px; }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .85rem; padding: 28px 0; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.draft-banner { background: #b45309; color: #fff; text-align: center; padding: 8px; font-size: .88rem; font-weight: 700; }
