:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e3e6ea;
  --text: #1f2933;
  --muted: #5b6573;
  --link: #1a5fb4;
  --link-hover: #0d3a7a;
  --accent: #ff7a00;
  --quote-bg: #f0f4f8;
  --code-bg: #1f2933;
  --code-text: #f6f7f9;
  --banner-bg: #fff4e0;
  --banner-border: #f0c674;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; }
.brand { font-weight: 600; font-size: 18px; color: var(--text); }
.topnav a { margin-left: 18px; color: var(--muted); }

.archive-banner {
  background: var(--banner-bg);
  border-top: 1px solid var(--banner-border);
  border-bottom: 1px solid var(--banner-border);
  padding: 10px 0;
  font-size: 14px;
}

main.container { padding-top: 20px; padding-bottom: 40px; }

.breadcrumbs { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.breadcrumbs .sep { margin: 0 6px; color: var(--muted); }

h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 24px; margin: 0 0 14px; }
h2 { font-size: 18px; margin: 18px 0 10px; }

/* Forum / thread listing tables */
.list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 24px;
}
.list-header {
  background: #f0f2f5;
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.list-row {
  display: grid;
  grid-template-columns: 1fr 90px 90px 200px;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.list-row:last-child { border-bottom: 0; }
.list-row .meta { font-size: 12px; color: var(--muted); }
.list-row .num { text-align: center; font-variant-numeric: tabular-nums; color: var(--muted); }
.forum-name { font-weight: 600; font-size: 16px; }
.forum-desc { font-size: 13px; color: var(--muted); margin-top: 2px; }
.thread-title { font-weight: 600; }
.thread-author { font-size: 13px; color: var(--muted); margin-top: 2px; }

@media (max-width: 720px) {
  .list-row { grid-template-columns: 1fr; gap: 4px; }
  .list-row .num { text-align: left; }
}

/* Thread post bubbles */
.post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: 180px 1fr;
  overflow: hidden;
}
.post-author {
  background: #f0f2f5;
  padding: 16px;
  border-right: 1px solid var(--border);
  text-align: center;
}
.post-author .avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #d8dde3;
  margin: 0 auto 8px;
  display: block;
  object-fit: cover;
}
.post-author .username { font-weight: 600; display: block; word-break: break-word; }
.post-author .usertitle { font-size: 12px; color: var(--muted); margin-top: 2px; }
.post-body { padding: 16px 20px; min-width: 0; }
.post-meta {
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.post-meta a.permalink { color: var(--muted); }
.post-content { word-wrap: break-word; overflow-wrap: break-word; }
.post-content p { margin: 0 0 10px; }
.post-content img { max-width: 100%; height: auto; border-radius: 4px; }
.post-content blockquote {
  border-left: 3px solid var(--accent);
  background: var(--quote-bg);
  margin: 10px 0;
  padding: 10px 14px;
  border-radius: 0 4px 4px 0;
}
.post-content blockquote .quote-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.post-content pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 12px 14px;
  border-radius: 4px;
  overflow-x: auto;
  font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace;
  white-space: pre;
}
.post-content code { font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; background: #eef0f3; padding: 1px 4px; border-radius: 3px; }
.post-content pre code { background: transparent; padding: 0; color: inherit; }
.post-content ul, .post-content ol { padding-left: 22px; }
.post-content hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
.post-attachments { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.post-attachments .attachment-link { display: inline-block; margin: 4px 8px 4px 0; padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; }

@media (max-width: 720px) {
  .post { grid-template-columns: 1fr; }
  .post-author { display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .post-author .avatar { width: 40px; height: 40px; margin: 0; }
}

/* Pagination */
.pager { display: flex; gap: 6px; margin: 18px 0; flex-wrap: wrap; }
.pager a, .pager span {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  font-size: 14px;
}
.pager .current { background: var(--link); color: #fff; border-color: var(--link); }

/* Profile pages */
.profile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 24px;
}
.profile .avatar { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; background: #d8dde3; }
.profile dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.profile dt { font-weight: 600; color: var(--muted); }
.profile dd { margin: 0; }
@media (max-width: 720px) { .profile { grid-template-columns: 1fr; } }

/* Search */
.search-form { display: flex; gap: 8px; margin-bottom: 20px; }
.search-form input[type=text] { flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: 4px; font-size: 16px; }
.search-form button { padding: 10px 20px; border: 0; background: var(--link); color: #fff; border-radius: 4px; font-size: 16px; cursor: pointer; }
.search-result { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 14px 18px; margin-bottom: 10px; }
.search-result .snippet { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* Poll */
.poll {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.poll h3 { margin-top: 0; }
.poll-option { margin: 8px 0; }
.poll-bar { background: #eef0f3; height: 22px; border-radius: 3px; overflow: hidden; margin-top: 4px; }
.poll-bar > span { display: block; height: 100%; background: var(--accent); }
.poll-meta { font-size: 12px; color: var(--muted); margin-top: 12px; }

.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 24px 0; margin-top: 40px; font-size: 13px; color: var(--muted); }
.site-footer p { margin: 4px 0; }

/* Dead-page notice */
.dead-notice {
  background: var(--banner-bg);
  border: 1px solid var(--banner-border);
  border-radius: 6px;
  padding: 20px;
  margin: 30px 0;
}
.dead-notice h2 { margin-top: 0; }
