:root {
    --bg: #eef2f6;
    --panel: #ffffff;
    --line: #d7dee8;
    --text: #1c2633;
    --muted: #66758a;
    --brand: #1c5d99;
    --brand-dark: #164a7a;
    --soft: #f6f8fb;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.35 Arial, Helvetica, sans-serif;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar { background: linear-gradient(180deg, #233a54, #182b42); color: #fff; border-bottom: 3px solid #e0a72e; }
.topbar-inner { width: 1120px; margin: 0 auto; padding: 10px 0; display: flex; align-items: center; gap: 16px; }
.brand { color: #fff; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.brand:hover { text-decoration: none; }
.main-nav { display: flex; gap: 14px; }
.main-nav a, .auth-links a { color: #edf4ff; }
.main-nav { margin-right: auto; }
.quick-search { margin-left: auto; }
.quick-search input, .auth-form input { border: 1px solid var(--line); border-radius: 4px; padding: 9px 10px; width: 100%; }
.auth-links { display: flex; align-items: center; gap: 10px; }
.button, button.button { background: var(--brand); color: #fff; border: 0; border-radius: 4px; padding: 9px 13px; cursor: pointer; display: inline-block; }
.button:hover { background: var(--brand-dark); color: #fff; text-decoration: none; }
.button.danger { background: #a52828; }
.button.danger:hover { background: #7f1e1e; }
.page-shell { width: 1120px; margin: 16px auto; padding: 0; }
.breadcrumbs { color: var(--muted); margin-bottom: 12px; font-size: 13px; }
.breadcrumbs span { margin: 0 6px; }
.content-grid { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
.content-grid-full { grid-template-columns: 1fr; }
.main-panel, .side-card, .reply-box, .profile-details, .latest-posts, .install-box { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.main-panel { overflow: hidden; }
.section-head { padding: 15px 18px; border-bottom: 1px solid var(--line); background: var(--soft); }
.section-head h1 { margin: 0 0 4px; font-size: 21px; }
.section-head p { margin: 0; color: var(--muted); }
.category-list, .thread-list, .post-list { display: grid; }
.category-card { padding: 6px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 38px minmax(260px, 1fr) auto; gap: 12px; align-items: center; }
.category-right, .thread-right { display: flex; gap: 4px; align-items: center; justify-self: end; }
.category-icon, .thread-icon { width: 34px; height: 34px; display: grid; place-items: center; background: #eef4fb; border: 1px solid var(--line); border-radius: 8px; font-size: 20px; }
.category-icon:hover, .thread-icon:hover { text-decoration: none; }
.category-main h2, .thread-main h2 { margin: 0 0 2px; font-size: 16px; line-height: 1.2; }
.category-main p, .thread-main p { margin: 0; color: var(--muted); }
.thread-title-row { display: block; }
.thread-title-row h2 { margin: 0; }
.thread-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.category-last, .thread-last { display: grid; gap: 2px; min-width: 0; width: 220px; max-width: 220px; line-height: 1.2; text-align: left; justify-items: start; }
.category-last a, .thread-last strong { white-space: normal; overflow-wrap: anywhere; word-break: normal; font-size: 12px; }
.category-last span, .thread-last span, .thread-last time { color: var(--muted); font-size: 11px; }
.thread-row { padding: 6px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 38px minmax(260px, 1fr) auto; gap: 12px; align-items: center; }
.stats { display: flex; gap: 12px; margin: 0; }
.stats div { min-width: 54px; text-align: center; background: transparent; border: 0; border-radius: 0; padding: 0; }
.stats dt { color: var(--muted); font-size: 12px; }
.stats dd { margin: 0; font-weight: 700; font-size: 15px; }
.sidebar { display: grid; gap: 18px; }
.side-card { padding: 14px; }
.side-card h3 { margin: 0 0 10px; font-size: 16px; }
.side-link { display: block; padding: 8px 0; border-top: 1px solid var(--line); }
.user-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.muted { color: var(--muted); }
.notice { margin: 18px; padding: 14px; background: #fff8df; border: 1px solid #ead38b; border-radius: 5px; }
.notice.error { background: #fff1f1; border-color: #e1a4a4; color: #8b1d1d; }
.post-card { display: grid; grid-template-columns: 190px 1fr; border-bottom: 1px solid var(--line); }
.post-author { background: var(--soft); padding: 12px; border-right: 1px solid var(--line); display: grid; gap: 3px; align-content: start; justify-items: center; text-align: center; color: var(--muted); font-size: 12px; }
.avatar { width: 100px; height: 100px; border-radius: 8px; object-fit: cover; background: #dbe3ed; }
.avatar.large { width: 100px; height: 100px; }
.author-name { font-weight: 700; font-size: 16px; }
.author-rank { display: inline-block; margin: 2px 0 4px; color: #315f1f; background: #e6f3df; border: 1px solid #c2ddb4; border-radius: 4px; padding: 2px 6px; font-size: 11px; }
.post-body { padding: 16px 18px; }
.post-body header { display: flex; justify-content: space-between; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 12px; }
blockquote { margin: 0 0 12px; padding: 10px 12px; background: #f1f5fa; border-left: 4px solid var(--brand); color: var(--muted); }
.message-text { max-width: none; width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; }
.post-links { margin-top: 8px; font-size: 12px; color: var(--muted); }
.post-links a { color: #2d5f93; }
.thread-head-row { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.post-actions { display: flex; justify-content: end; margin-top: 10px; }
.delete-link { border: 0; background: transparent; color: #9b2a2a; font-size: 12px; cursor: pointer; padding: 0; text-decoration: underline; }
.reply-box, .profile-details, .latest-posts { margin: 0; padding: 16px; border-left: 0; border-right: 0; border-radius: 0; }
.quick-reply { margin: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: #fff; overflow: hidden; }
.quick-reply h2 { margin: 0; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--soft); font-size: 16px; }
.quick-reply-toolbar { display: flex; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.quick-reply-toolbar button { border: 1px solid var(--line); background: #fff; border-radius: 3px; padding: 5px 8px; color: var(--text); cursor: default; }
.quick-reply textarea { display: block; width: 100%; border: 0; resize: vertical; min-height: 130px; padding: 12px 14px; font: inherit; outline: none; }
.reply-warning { margin: 0 14px 12px; padding: 10px 12px; background: #fff1f1; border: 1px solid #e1a4a4; border-radius: 4px; color: #8b1d1d; }
.quick-reply-actions { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); background: #fbfcfe; }
.auth-form { padding: 18px; display: grid; gap: 14px; max-width: 420px; }
.auth-form label { display: grid; gap: 6px; color: var(--muted); }
.profile-head { padding: 20px; display: flex; gap: 18px; align-items: center; border-bottom: 1px solid var(--line); background: var(--soft); }
.profile-head h1 { margin: 0; }
.badge { display: inline-block; background: #e0a72e; color: #2b2109; border-radius: 999px; padding: 4px 10px; font-weight: 700; }
.profile-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 18px; }
.info-card { background: var(--soft); border: 1px solid var(--line); padding: 12px; display: grid; gap: 4px; }
.profile-details dl { display: grid; grid-template-columns: 140px 1fr; gap: 10px; }
.profile-details dt { color: var(--muted); }
.mini-post { border-top: 1px solid var(--line); padding: 10px 0; }
.users-list { display: grid; }
.user-row { padding: 14px 18px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 82px 1fr auto 130px; gap: 16px; align-items: center; }
.user-row { column-gap: 35px; }
.user-row h2 { margin: 0 0 2px; font-size: 18px; }
.user-row p { margin: 0; color: var(--muted); }
.user-row-avatar:hover { text-decoration: none; }
.user-row-date { display: grid; gap: 4px; color: var(--muted); font-size: 13px; text-align: right; }
.user-row-date strong { color: var(--text); }
.pager-wide { padding: 16px 18px; display: flex; gap: 12px; align-items: center; justify-content: center; }
.pager-wide span { color: var(--muted); }
.footer { width: 1120px; margin: 22px auto; padding: 0; color: var(--muted); }
.install-box { max-width: 720px; margin: 40px auto; padding: 20px; }
.home-bottom-blocks { padding: 10px 0; display: grid; gap: 8px; background: var(--bg); border-top: 1px solid var(--line); }
.two-col-bottom-blocks { grid-template-columns: 0.4fr 1.6fr; gap: 10px; align-items: stretch; }
.two-col-bottom-blocks .bottom-card { height: 100%; }
.bottom-card { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; }
.bottom-card h2 { margin: 0 0 6px; font-size: 13px; color: #2d6a29; }
.bottom-card h3 { margin: 10px 0 4px; font-size: 12px; }
.stats-lines { display: grid; gap: 4px; }
.stats-lines.inline { display: flex; gap: 10px; flex-wrap: wrap; }
.stats-lines span { color: var(--muted); font-size: 12px; }
.stats-lines strong { color: var(--text); margin-left: 4px; }
.forum-stats { background: #fbfffa; border-color: #b6d6af; }
.forum-stats-grid { display: grid; grid-template-columns: 1fr; gap: 4px; }
.forum-stats-grid span { font-size: 12px; color: #395235; }
.forum-stats-grid b { font-size: 15px; color: #23431d; margin-right: 4px; }
.forum-stats-today { margin-top: 6px; display: grid; gap: 2px; font-size: 12px; color: #4d6a49; }
.online-block .user-cloud a { font-size: 12px; }
.online-block .muted { font-size: 11px; }
.user-cloud.wide { gap: 10px 14px; line-height: 1.8; }
.latest-line { display: grid; gap: 3px; padding: 10px 0; border-top: 1px solid var(--line); }
.latest-line span { color: var(--muted); font-size: 13px; }
.compact-bottom-blocks { padding: 8px 0 14px; gap: 0; background: transparent; border-top: 0; }
.latest-block-compact { border: 1px solid #a8cfa1; border-radius: 3px; padding: 0; overflow: hidden; background: #fbfffa; }
.latest-block-compact h2 { margin: 0; padding: 6px 10px; background: #dff1db; border-bottom: 1px solid #a8cfa1; color: #2d6a29; font-size: 13px; line-height: 1.2; }
.latest-block-compact .latest-line { padding: 5px 10px; gap: 0; border-top: 1px solid #e8f2e5; line-height: 1.2; }
.latest-block-compact .latest-line:first-of-type { border-top: 0; }
.latest-block-compact .latest-line a { font-size: 12px; }
.latest-block-compact .latest-line span { font-size: 11px; }
