:root {
  --bg: #f6f7f9; --surface: #ffffff; --text: #1f2328; --muted: #656d76; --border: #d8dee4;
  --accent: #0b5cad; --accent-soft: #e7f0fa; --question: #fff8e6; --mark: #fff2a8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181c; --surface: #1e2227; --text: #e6e8eb; --muted: #9aa3ad; --border: #343a42;
    --accent: #6cb0f5; --accent-soft: #1c2b3b; --question: #2a2617; --mark: #5c4f12;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.75 system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.site-title { font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; }
.header-search { margin-left: auto; }
.header-search input { width: 240px; max-width: 60vw; }

input[type=search] { font: inherit; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); }
button { font: inherit; padding: 6px 16px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; cursor: pointer; }

main { padding: 24px 16px 48px; }
.page-title, .thread-title { font-size: 24px; line-height: 1.4; margin: 8px 0 12px; }
.crumbs, .thread-meta, .status, .meta { color: var(--muted); font-size: 13px; }

.search-box { display: flex; gap: 8px; margin: 0 0 8px; }
.search-box input { flex: 1; font-size: 16px; padding: 8px 12px; }

.forum { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin: 16px 0; }
.forum h2 { font-size: 16px; margin: 0; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--accent-soft); border-radius: 8px 8px 0 0; }
.forum .count { color: var(--muted); font-weight: 400; font-size: 13px; }
.thread-list, .results { list-style: none; margin: 0; padding: 0; }
.thread-list li { padding: 8px 16px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.thread-list li:first-child { border-top: 0; }
.thread-list .meta { margin-left: auto; }

.results li { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; margin: 10px 0; }
.results h2 { font-size: 16px; margin: 0 0 4px; }
.results p { margin: 0; font-size: 14px; }
mark { background: var(--mark); color: inherit; padding: 0 1px; }

.post { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin: 14px 0; overflow: hidden; }
.post-question { background: var(--question); }
.post-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 8px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.post-author { font-weight: 700; font-size: 14px; }
.post-label { color: var(--accent); }
.post-date { margin-left: auto; color: var(--muted); }
.post-body { padding: 12px 16px; overflow-wrap: anywhere; }
.post-body img { max-width: 100%; height: auto; }
.post-body pre, .post-body code, .post-body .codeblock { font-family: Consolas, "Courier New", monospace; font-size: 13px; }
.post-body .codeblock, .post-body blockquote { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; margin: 8px 0; overflow-x: auto; }
.post-body .codeblock .title, .post-body blockquote cite { display: block; font-weight: 700; font-style: normal; font-size: 12px; color: var(--muted); }
.post-body fieldset { border: 1px solid var(--border); border-radius: 6px; }

.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; padding: 16px 0; }
