:root {
  --bg: #12141a; --card: #1a1d26; --card2: #20242f; --line: #2a2f3d;
  --text: #dfe3ee; --muted: #8a92a6; --accent: #ff6fa3; --accent2: #ff4d8d; --green: #4ade80; --red: #f87171;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 system-ui, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
h1 { font-size: 22px; margin: 18px 0 8px; }
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }
.grow { flex: 1; }

.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.bar { display: flex; align-items: center; gap: 18px; height: 54px; }
.logo { font-size: 20px; font-weight: 800; color: var(--accent); }
.top nav { display: flex; gap: 14px; }
.top nav a { color: var(--text); }
.qsearch { flex: 1; max-width: 320px; }
.qsearch input { width: 100%; }
.auth { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.auth form { margin: 0; }
.pm { position: relative; font-size: 18px; }
.badge { position: absolute; top: -6px; right: -10px; background: var(--accent2); color: #fff; border-radius: 9px; font-size: 11px; padding: 0 5px; }

.layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; margin-top: 16px; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } .bar { flex-wrap: wrap; height: auto; padding: 8px 16px; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; margin: 14px 0; overflow: hidden; }
.layout .card:first-child { margin-top: 0; }
.card-h { margin: 0; padding: 10px 14px; background: var(--card2); border-bottom: 1px solid var(--line); font-size: 15px; }
.narrow { max-width: 420px; margin: 40px auto; }
.pad { padding: 14px; }
.empty { padding: 20px; text-align: center; color: var(--muted); }
.mini { padding: 9px 14px; border-bottom: 1px solid var(--line); }
.mini:last-child { border-bottom: 0; }

.node, .trow { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.node:last-child, .trow:last-child { border-bottom: 0; }
.node-icon { font-size: 26px; width: 40px; text-align: center; }
.node-main, .trow-main { flex: 1; min-width: 0; }
.node-title { font-weight: 600; font-size: 15px; }
.node-stats { width: 100px; color: var(--muted); font-size: 12px; text-align: right; }
.node-stats b { color: var(--text); }
.node-last { width: 210px; font-size: 13px; }
@media (max-width: 700px) { .node-stats, .node-last { display: none; } }

.crumbs { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.modbar { display: flex; gap: 6px; }
.modbar form { margin: 0; }
.prefix { background: var(--accent2); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 4px; margin-right: 6px; vertical-align: middle; }
.prefix.red { background: var(--red); }

.post { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 8px; margin: 12px 0; overflow: hidden; }
.author { width: 180px; flex-shrink: 0; background: var(--card2); padding: 16px 12px; text-align: center; border-right: 1px solid var(--line); }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #8b5cf6); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 22px; margin: 0 auto 8px; }
.avatar.big { width: 90px; height: 90px; font-size: 36px; margin: 0; flex-shrink: 0; }
.trow .avatar { margin: 0; width: 38px; height: 38px; font-size: 16px; }
.uname { font-weight: 700; font-size: 15px; display: block; }
.utitle { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.role-admin { color: var(--red) !important; }
.role-mod { color: var(--green) !important; }
.post-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.post-meta { display: flex; justify-content: space-between; padding: 8px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.content { padding: 14px 16px; overflow-wrap: anywhere; }
.content pre { background: #0d0f14; border: 1px solid var(--line); border-radius: 6px; padding: 10px; overflow-x: auto; }
.content blockquote { margin: 8px 0; padding: 8px 12px; background: var(--card2); border-left: 3px solid var(--accent); border-radius: 4px; color: var(--muted); }
.qwho { font-weight: 600; color: var(--accent); font-size: 12px; }
.bbimg { max-width: 100%; border-radius: 6px; }
.attachments { padding: 0 16px 10px; }
.attach { display: inline-block; margin: 4px 8px 0 0; padding: 6px 10px; background: var(--card2); border: 1px solid var(--line); border-radius: 6px; }
.post-actions { margin-top: auto; display: flex; align-items: center; gap: 14px; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.post-actions form { margin: 0; }
@media (max-width: 700px) { .post { flex-direction: column; } .author { width: auto; border-right: 0; border-bottom: 1px solid var(--line); } }

.profile { display: flex; gap: 20px; align-items: flex-start; }
.profile h1 { margin-top: 0; }

.pager { display: flex; gap: 4px; margin: 10px 0; flex-wrap: wrap; }
.pager a { padding: 4px 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--card); }
.pager a.cur { background: var(--accent2); color: #fff; border-color: var(--accent2); }

input, textarea, select { background: #0f1117; border: 1px solid var(--line); color: var(--text); padding: 8px 10px; border-radius: 6px; font: inherit; }
input:focus, textarea:focus, select:focus { outline: 1px solid var(--accent); border-color: var(--accent); }
textarea { width: 100%; resize: vertical; }
label { display: block; margin-bottom: 12px; color: var(--muted); }
label input:not([type=checkbox]):not([type=file]), label select, label textarea { display: block; width: 100%; margin-top: 4px; color: var(--text); }
label.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
input[type=file] { border: 0; padding: 4px 0; background: none; }

.btn { display: inline-block; background: var(--accent2); color: #fff; border: 0; padding: 8px 16px; border-radius: 6px; cursor: pointer; font: inherit; font-weight: 600; }
.btn:hover { background: var(--accent); text-decoration: none; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.ghost { background: var(--card2); border: 1px solid var(--line); color: var(--text); }
.btn.danger { background: var(--red); }
.linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
.linkbtn.on { color: var(--green); }
.danger-t { color: var(--red); }

.bbbar { display: flex; gap: 4px; margin-bottom: 6px; flex-wrap: wrap; }
.bbbar button { background: var(--card2); border: 1px solid var(--line); color: var(--text); padding: 3px 10px; border-radius: 5px; cursor: pointer; }
.bbbar button:hover { border-color: var(--accent); }

.flash { background: #1f3a2b; border: 1px solid #2f6b4a; color: #b6f0cd; padding: 10px 14px; border-radius: 8px; margin-top: 14px; }
.err { background: #3a1f24; border: 1px solid #6b2f3a; color: #f5b6bf; padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; }
.foot { text-align: center; color: var(--muted); padding: 30px 16px; font-size: 12px; }
