:root {
  --bg: #f6f7f9; --card: #fff; --ink: #1d2330; --muted: #6b7385;
  --line: #e2e5ec; --accent: #2456d6; --danger: #b3261e;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.top nav { display: flex; align-items: center; gap: 16px; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.me { display: flex; align-items: center; gap: 8px; font-weight: 600; }

.search { display: flex; flex: 1; max-width: 360px; min-width: 160px; }
.search input { border-radius: 6px 0 0 6px; border-right: 0; }
.search button { border: 1px solid var(--line); border-left: 0; background: var(--card); border-radius: 0 6px 6px 0; padding: 0 12px; cursor: pointer; }

main { max-width: 760px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { font-size: 1.6rem; margin: 8px 0 20px; }
h2 { font-size: 1.1rem; margin: 28px 0 12px; color: var(--muted); }

.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.me .avatar { width: 28px; height: 28px; }
.avatar-letter { display: inline-flex; align-items: center; justify-content: center; background: #dbe4fb; color: var(--accent); font-weight: 700; }
.me .avatar-letter { font-size: .8rem; }

.thread-list { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.thread-list li { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.thread-list li:last-child { border-bottom: 0; }
.grow { flex: 1; min-width: 0; }
.thread-title { font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.thread-title:hover { color: var(--accent); }
.meta, .count { color: var(--muted); font-size: .875rem; }
.count { white-space: nowrap; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; margin-bottom: 14px; }
.post .author { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.post .body { overflow-wrap: anywhere; }
.op { border-left: 4px solid var(--accent); }

.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head .avatar { width: 64px; height: 64px; font-size: 1.4rem; }
.profile-head h1 { margin: 0 0 4px; }

.form label { display: block; font-weight: 600; margin: 12px 0 6px; }
.form label:first-of-type { margin-top: 0; }
input:not([type=hidden]), textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; }
textarea { resize: vertical; }

.btn { display: inline-block; padding: 8px 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.primary { margin-top: 14px; background: var(--accent); border-color: var(--accent); color: #fff; }
.link { background: none; border: 0; padding: 0; margin-top: 10px; font: inherit; font-size: .875rem; cursor: pointer; text-decoration: underline; }
.danger { color: var(--danger); }
.error { background: #fdecea; color: var(--danger); padding: 10px 14px; border-radius: 6px; }
.empty { color: var(--muted); }

.pager { display: flex; gap: 6px; margin: 18px 0; }
.pager a, .pager .current { padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); text-decoration: none; }
.pager .current { background: var(--accent); border-color: var(--accent); color: #fff; }

.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.badge-pending { background: #fff4d6; color: #8a6400; }
.badge-rejected { background: #fdecea; color: var(--danger); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 16px; }
.stat { text-decoration: none; color: var(--ink); text-align: center; padding: 20px 14px; }
.stat strong { display: block; font-size: 2rem; color: var(--accent); }
.stat span { color: var(--muted); font-size: .9rem; }

.row-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.row-actions form { margin: 0; }
.row-actions .link { margin-top: 0; }

@media (max-width: 520px) { .thread-list li { flex-wrap: wrap; } .count { width: 100%; padding-left: 54px; } .search { order: 3; max-width: none; flex-basis: 100%; } }
