:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #656d76;
  --border: #d8dee4;
  --accent: #c2185b;
  --accent-soft: #fde7ef;
  --link: #0b62c4;
  --code-bg: #f3f4f6;
  --quote-bg: #f8f9fb;
  --header-bg: #ffffff;
  --c-green: #1a7f37;
  --c-red: #cf222e;
  --c-blue: #0550ae;
  --c-orange: #bc4c00;
  --c-purple: #8250df;
  --c-gray: #6e7781;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --surface: #171b21;
    --text: #e6e8eb;
    --muted: #9aa3ad;
    --border: #2d333b;
    --accent: #f06292;
    --accent-soft: #3a1e2a;
    --link: #6cb6ff;
    --code-bg: #0d1014;
    --quote-bg: #1c2128;
    --header-bg: #171b21;
    --c-green: #56d364;
    --c-red: #ff7b72;
    --c-blue: #79c0ff;
    --c-orange: #ffa657;
    --c-purple: #d2a8ff;
    --c-gray: #9aa3ad;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px; }

.site-header { background: var(--header-bg); border-bottom: 3px solid var(--accent); }
.brand { display: flex; align-items: center; gap: 14px; padding: 10px 0; color: var(--text); font-weight: 600; font-size: 26px; line-height: 1.2; }
.brand:hover { text-decoration: none; }
.brand small { color: var(--muted); font-weight: 400; font-size: 17px; margin-left: 8px; }

.notice { background: var(--accent-soft); border-bottom: 1px solid var(--border); font-size: 14px; padding: 8px 0; }

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

h1 { font-size: 26px; line-height: 1.25; margin: 4px 0 4px; overflow-wrap: anywhere; }
.intro { color: var(--muted); margin: 0 0 18px; }

footer { color: var(--muted); font-size: 13px; padding-top: 24px; padding-bottom: 32px; }

/* Board and topic lists */
.list { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.list th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; background: var(--quote-bg); }
.list th, .list td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.list tr:last-child td { border-bottom: none; }
.list .num { text-align: right; width: 80px; white-space: nowrap; }
.list .last { width: 160px; white-space: nowrap; font-size: 13px; }
.board-name { font-weight: 600; font-size: 16px; }
.desc, .by { color: var(--muted); font-size: 13px; }
.flag { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); margin-right: 2px; }

/* Posts */
.post { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; margin-bottom: 14px; padding: 12px 16px 14px; }
.post:target { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.post-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; border-bottom: 1px solid var(--border); padding-bottom: 6px; margin-bottom: 8px; }
.author { font-weight: 600; }
.role { font-size: 11px; padding: 0 6px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.permalink { margin-left: auto; color: var(--muted); font-size: 13px; }
.post-subject { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.post-body { overflow-wrap: anywhere; }
.post-body img { max-width: 100%; height: auto; }
.edited { color: var(--muted); font-size: 12px; font-style: italic; margin-top: 10px; }
.smiley { font-style: normal; }
.c-green { color: var(--c-green); }
.c-red { color: var(--c-red); }
.c-blue { color: var(--c-blue); }
.c-orange { color: var(--c-orange); }
.c-purple { color: var(--c-purple); }
.c-gray { color: var(--c-gray); }

.bbc-code { margin: 8px 0; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.code-header, .quote-header { font-size: 12px; color: var(--muted); padding: 3px 10px; background: var(--quote-bg); border-bottom: 1px solid var(--border); }
.bbc-code pre { margin: 0; padding: 10px; background: var(--code-bg); overflow-x: auto; max-height: 500px; }
code, pre { font: 13px/1.45 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; }
pre code { white-space: pre; }

blockquote.bbc-quote { margin: 8px 0; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 4px; background: var(--quote-bg); }
.quote-header { background: transparent; }
.quote-body { padding: 6px 10px; }

table.bbc { border-collapse: collapse; }
table.bbc td { border: 1px solid var(--border); padding: 2px 6px; }

.attachments { margin-top: 12px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 14px; }
.att-title { font-size: 12px; color: var(--muted); }
.attachments ul { margin: 2px 0 0; padding-left: 18px; }
.att-images { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.att-images img { max-width: 320px; max-height: 240px; border: 1px solid var(--border); border-radius: 4px; }

.poll { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 10px 16px; margin-bottom: 14px; }
.poll h2 { font-size: 16px; margin: 0 0 8px; }
.poll ul { list-style: none; margin: 0; padding: 0; }
.poll li { display: grid; grid-template-columns: minmax(0, 1fr) 160px 70px; gap: 10px; align-items: center; padding: 3px 0; font-size: 14px; }
.poll .bar { height: 10px; background: var(--quote-bg); border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.poll .bar span { display: block; height: 100%; background: var(--accent); }
.poll .votes { color: var(--muted); font-size: 13px; text-align: right; }

.back { margin-top: 20px; }

@media (max-width: 640px) {
  .list .num:nth-child(3), .list th.num:nth-child(3) { display: none; }
  .list .last { display: none; }
  .brand { font-size: 21px; gap: 10px; }
  .brand img { width: 40px; height: 40px; }
  .brand small { display: block; margin-left: 0; font-size: 14px; }
  .poll li { grid-template-columns: 1fr 70px; }
  .poll .bar { grid-column: 1 / -1; grid-row: 2; }
  .att-images img { max-width: 100%; }
}
