:root {
	--ink: #1d2433;
	--muted: #5b6474;
	--line: #e3e6eb;
	--soft: #f5f6f8;
	--bg: #fff;
	--link: #b23c0b;
	--link-hover: #8a2d06;
	--focus: #2563eb;
	--il: #1976d2;
	--radius: 10px;
	--wrap: 1160px;
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--font); }
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.01em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 800px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 20; background: #fff; padding: 8px 12px; }

/* header */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,0.96); border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.4) blur(6px); }
.header-inner { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 18px; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.nav { display: flex; gap: 20px; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; white-space: nowrap; }
.nav a:hover { color: var(--ink); }
.search { position: relative; margin-left: auto; }
.search input { width: 260px; height: 38px; padding: 0 12px 0 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235b6474' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px center; font: inherit; font-size: 15px; color: var(--ink); }
.search input:focus { background-color: #fff; border-color: #b9c0cb; outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.search-results { position: absolute; right: 0; top: 46px; width: min(460px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 16px 40px rgba(16,24,40,0.14); padding: 6px; }
.sr-item, .sr-all { display: block; padding: 10px 12px; border-radius: 7px; text-decoration: none; color: var(--ink); }
.sr-item:hover, .sr-item:focus, .sr-item.active, .sr-all:hover, .sr-all.active { background: var(--soft); outline: none; }
.sr-title { display: block; font-weight: 600; font-size: 15px; }
.sr-snippet { display: block; font-size: 13px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.sr-all { color: var(--link); font-weight: 600; font-size: 14px; }
.sr-empty, .sr-wait { margin: 0; padding: 12px; color: var(--muted); font-size: 14px; }
mark { background: #fff1b8; color: inherit; padding: 0 1px; border-radius: 2px; }

/* hero */
.hero { background: var(--soft); border-bottom: 1px solid var(--line); padding: 56px 0 40px; }
.hero h1 { font-size: clamp(2.1rem, 4vw, 2.9rem); margin: 0 0 12px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 720px; margin: 0 0 24px; }
.hero-search { display: flex; gap: 8px; max-width: 620px; }
.hero-search input { flex: 1; min-width: 0; height: 50px; padding: 0 16px; border: 1px solid #cdd2da; border-radius: 10px; font: inherit; font-size: 17px; background: #fff; color: var(--ink); }
.hero-search input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.hero-search button, .btn { height: 50px; padding: 0 22px; border: 0; border-radius: 10px; background: var(--ink); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.hero-search button:hover { background: #000; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); text-decoration: none; font-size: 14px; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip span { color: var(--muted); font-size: 12px; }

/* sections + cards */
.section { padding: 44px 0 8px; }
.section-head { margin-bottom: 18px; }
.section-head h2 { margin: 0 0 4px; font-size: 1.55rem; }
.section-head h2 a { color: var(--ink); text-decoration: none; }
.section-head h2 a:hover { text-decoration: underline; }
.section-head p { margin: 0; color: var(--muted); max-width: 760px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.card:hover { color: var(--ink); border-color: #c5cbd4; box-shadow: 0 10px 28px rgba(16,24,40,0.08); }
.card-img { display: block; width: 100%; aspect-ratio: 640 / 336; object-fit: cover; background: var(--soft); }
.card-img-empty { display: flex; align-items: center; justify-content: center; font-size: 56px; }
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; }
.card-cat { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.card-title { font-weight: 650; font-size: 1.05rem; line-height: 1.35; }
.card:hover .card-title { text-decoration: underline; text-underline-offset: 2px; }
.card-icon { margin-right: 6px; }
.card-desc { color: var(--muted); font-size: 14.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.more { margin: 16px 0 0; font-weight: 600; }
.link-list { columns: 2 320px; padding-left: 20px; margin: 0; }
.link-list li { margin-bottom: 6px; break-inside: avoid; }

/* page header (category, search, 404) */
.page-head { padding: 36px 0 24px; }
.page-head h1 { font-size: clamp(1.9rem, 3.5vw, 2.5rem); margin: 4px 0 10px; }
.crumbs { font-size: 14px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.side-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 8px; }
.other-topics { align-items: center; margin: 32px 0 48px; }
.other-topics .side-label { margin: 0 6px 0 0; }

/* search page */
.result-count { color: var(--muted); }
.results { list-style: none; padding: 0; margin: 0 0 48px; }
.results li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.results li > a { font-weight: 650; font-size: 1.1rem; }
.result-cat { margin-left: 8px; font-size: 13px; color: var(--muted); }
.results p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }

/* post */
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 56px; padding-top: 28px; }
.post { min-width: 0; max-width: 760px; }
.post h1 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); margin: 10px 0 20px; }
.post-icon { margin-right: 10px; }
.post-hero { display: block; width: 100%; aspect-ratio: 1400 / 560; object-fit: cover; border-radius: var(--radius); margin-bottom: 28px; background: var(--soft); }
.post-side { position: sticky; top: 84px; align-self: start; display: flex; flex-direction: column; gap: 24px; padding-top: 44px; }
.toc ol { list-style: none; padding: 0 0 0 12px; margin: 0; border-left: 2px solid var(--line); }
.toc li { margin: 0 0 8px; font-size: 14px; line-height: 1.4; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--ink); text-decoration: underline; }
.related { padding: 32px 20px 56px; border-top: 1px solid var(--line); margin-top: 56px; }
.related h2 { font-size: 1.35rem; margin: 0 0 18px; }
.related h2 a { color: var(--ink); }

/* article content */
.prose { font-size: 1.0625rem; line-height: 1.72; overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.55rem; margin: 2.2em 0 0.6em; }
.prose h3 { font-size: 1.25rem; margin: 1.8em 0 0.5em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose li { margin-bottom: 0.35em; }
.prose li > ul, .prose li > ol { margin: 0.35em 0 0; }
.prose img { display: block; border: 1px solid var(--line); border-radius: 8px; margin: 1.4em 0 0.4em; }
.prose p > img + em, .prose p > em:only-child { display: block; font-size: 14px; color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose blockquote { margin: 1.4em 0; padding: 2px 0 2px 18px; border-left: 3px solid var(--line); color: var(--muted); }
.prose code { font-family: var(--mono); font-size: 0.88em; background: var(--soft); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.prose pre, .prose pre[class*="language-"] { margin: 1.4em 0; padding: 16px 18px; background: #f7f8fa; border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; font-size: 14px; line-height: 1.55; }
.prose pre code, .prose pre code[class*="language-"] { background: none; border: 0; padding: 0; font-size: inherit; text-shadow: none; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.prose details { margin: 1.2em 0; border: 1px solid var(--line); border-radius: 8px; padding: 10px 16px; }
.prose summary { cursor: pointer; font-weight: 600; }
.prose details[open] summary { margin-bottom: 10px; }
.callout { margin: 1.4em 0; padding: 14px 18px; background: #fbf6ec; border: 1px solid #f0e2c4; border-radius: 8px; }
.callout > :last-child { margin-bottom: 0; }
.bookmark { display: flex; flex-direction: column; gap: 2px; margin: 1.2em 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); text-decoration: none; }
.bookmark:hover { color: var(--ink); border-color: #c5cbd4; background: var(--soft); }
.bookmark strong { font-weight: 600; }
.bookmark span { font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bookmark small { font-size: 13px; color: var(--link); }
.video { position: relative; aspect-ratio: 16 / 9; margin: 1.4em 0; border-radius: 8px; overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* InfoLobby ad */
.ad-card { border: 1px solid #cfe0f5; background: #f4f8fd; border-radius: var(--radius); padding: 18px; }
.ad-head { display: flex; align-items: center; gap: 10px; }
.ad-head img { border-radius: 8px; }
.ad-label { font-size: 12px; color: var(--muted); }
.ad-card .ad-title { font-weight: 700; font-size: 1.2rem; color: var(--ink); margin: 10px 0 4px; }
.ad-card p { font-size: 14.5px; color: #3c4656; margin: 0 0 14px; line-height: 1.5; }
.ad-card .btn { display: flex; align-items: center; justify-content: center; height: 42px; background: var(--il); text-decoration: none; font-size: 15px; }
.ad-card .btn:hover { background: #135ba7; color: #fff; }
.ad-wide { margin: 48px 0 8px; border: 1px solid #cfe0f5; border-radius: var(--radius); overflow: hidden; background: #f4f8fd; }
.ad-wide img { display: block; width: 100%; }
.ad-wide p { margin: 0; padding: 14px 20px; font-size: 15px; }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--soft); margin-top: 48px; font-size: 14px; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 24px 20px; }
.site-footer a { color: var(--muted); }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }

@media (max-width: 980px) {
	.post-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
	.post { max-width: none; }
	.post-side { position: static; padding-top: 32px; }
	.toc { display: none; }
	.nav { display: none; }
}
@media (max-width: 600px) {
	.header-inner { gap: 12px; }
	.brand span { display: none; }
	.search { flex: 1; }
	.search input { width: 100%; }
	.hero { padding: 36px 0 28px; }
	.hero-search button { padding: 0 16px; }
	.prose { font-size: 1rem; }
}
