.forum-main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 44px 24px 90px;
}

.forum-narrow {
    max-width: 820px;
}

.forum-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 26px;
    animation: itemIn 0.6s var(--ease-out) both;
}

.forum-header h1 {
    font-size: clamp(30px, 4vw, 40px);
    font-weight: 700;
    letter-spacing: -1px;
}

.forum-header p {
    margin-top: 8px;
    font-size: 15px;
    color: #a3a6ad;
}

.forum-primary,
.forum-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 20px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s, background 0.2s;
}

.forum-primary {
    color: #1e1f22;
    background: linear-gradient(180deg, #ffffff 0%, #dfe1e6 100%);
    border: none;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
}

.forum-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
}

.forum-primary svg {
    width: 16px;
    height: 16px;
}

.forum-secondary {
    color: #c4c7cd;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.forum-secondary:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.forum-alert {
    margin-bottom: 18px;
}

.forum-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    font-size: 13.5px;
    font-weight: 600;
    color: #a3a6ad;
    transition: color 0.2s;
}

.forum-back:hover {
    color: #ffffff;
}

.forum-back svg {
    width: 16px;
    height: 16px;
}

.forum-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    animation: itemIn 0.6s var(--ease-out) 0.05s both;
}

.forum-categories a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 13.5px;
    font-weight: 500;
    color: #a3a6ad;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.forum-categories a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.forum-categories a.active {
    color: #ffffff;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.12);
}

.forum-categories span {
    min-width: 20px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    color: #c4c7cd;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
}

.forum-category-description {
    margin-bottom: 18px;
    font-size: 13.5px;
    color: #80848e;
}

.forum-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 16px;
    text-align: center;
    background: rgba(0, 0, 0, 0.12);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 24px;
}

.forum-empty svg {
    width: 42px;
    height: 42px;
    margin-bottom: 14px;
    color: #80848e;
}

.forum-empty h2 {
    font-size: 18px;
    font-weight: 700;
}

.forum-empty p {
    margin-top: 6px;
    font-size: 13.5px;
    color: #a3a6ad;
}

.thread-list {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    list-style: none;
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-top-color: rgba(255, 255, 255, 0.14);
    border-radius: 24px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.25);
}

.thread-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    animation: itemIn 0.5s var(--ease-out) var(--delay, 0s) both;
    transition: background 0.2s;
}

.thread-row:last-child {
    border-bottom: none;
}

.thread-row:hover {
    background: rgba(255, 255, 255, 0.035);
}

.thread-row.is-pinned {
    background: linear-gradient(90deg, rgba(245, 179, 1, 0.07) 0%, rgba(245, 179, 1, 0) 60%);
}

.thread-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.thread-main {
    min-width: 0;
}

.thread-title {
    display: flex;
    align-items: center;
    gap: 7px;
    overflow: hidden;
    font-size: 15.5px;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: color 0.2s;
}

.thread-title:hover {
    color: #ffffff;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.3);
    text-underline-offset: 3px;
}

.thread-flag {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
}

.flag-pin {
    color: #f5b301;
}

.flag-lock {
    color: #a3a6ad;
}

.thread-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
    font-size: 12.5px;
    color: #80848e;
}

.thread-author {
    font-weight: 600;
}

.thread-category:hover {
    color: #ffffff;
}

.thread-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    font-size: 12px;
    color: #80848e;
    white-space: nowrap;
}

.thread-replies {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: #c4c7cd;
}

.thread-replies svg {
    width: 14px;
    height: 14px;
}

.forum-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 22px;
}

.forum-pagination a {
    display: grid;
    place-items: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: #a3a6ad;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    transition: color 0.2s, background 0.2s;
}

.forum-pagination a:hover,
.forum-pagination a.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.forum-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.field-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.char-counter {
    font-size: 12px;
    color: #80848e;
    font-variant-numeric: tabular-nums;
}

.char-counter.near-limit {
    color: #fcd34d;
}

.field select,
.field textarea {
    font: inherit;
    font-size: 14px;
    color: var(--text);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.field select {
    height: 44px;
    padding: 0 14px;
    cursor: pointer;
}

.field select option {
    color: #f2f3f5;
    background: #2b2d31;
}

.field textarea {
    min-height: 120px;
    padding: 12px 14px;
    line-height: 1.6;
    resize: vertical;
}

.field select:focus,
.field textarea:focus {
    background: rgba(0, 0, 0, 0.26);
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06);
}

.field textarea::placeholder {
    color: #6b6e75;
}

.forum-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.thread-header {
    margin-bottom: 22px;
    animation: itemIn 0.6s var(--ease-out) both;
}

.thread-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.thread-badge {
    padding: 3px 11px;
    font-size: 12px;
    font-weight: 600;
    color: #c4c7cd;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}

.badge-pin {
    color: #f5b301;
    background: rgba(245, 179, 1, 0.1);
    border-color: rgba(245, 179, 1, 0.3);
}

.badge-lock {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.28);
}

.thread-heading {
    margin-top: 12px;
    font-size: clamp(24px, 3.5vw, 34px);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.8px;
    word-break: break-word;
}

.mod-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    padding: 10px 12px;
    background: rgba(245, 179, 1, 0.05);
    border: 1px solid rgba(245, 179, 1, 0.18);
    border-radius: 16px;
}

.mod-label {
    margin-right: 6px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #f5b301;
}

.mod-btn {
    height: 32px;
    padding: 0 14px;
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    color: #f2f3f5;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.mod-btn:hover {
    background: rgba(255, 255, 255, 0.14);
}

.mod-danger {
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

.mod-danger:hover {
    color: #ffffff;
    background: rgba(239, 68, 68, 0.8);
    border-color: rgba(239, 68, 68, 0.9);
}

.post-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.post {
    display: grid;
    grid-template-columns: 150px 1fr;
    overflow: hidden;
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 22px;
    scroll-margin-top: 90px;
    animation: itemIn 0.5s var(--ease-out) both;
}

.post.is-original {
    border-top-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.25);
}

.post:target {
    border-color: rgba(255, 255, 255, 0.3);
}

.post-author {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 22px 14px;
    text-align: center;
    background: rgba(0, 0, 0, 0.14);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.post-avatar {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 6px 16px rgba(0, 0, 0, 0.3);
}

.post-name {
    font-size: 14px;
    font-weight: 700;
    word-break: break-word;
}

a.post-name:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.post-name.is-deleted {
    color: #80848e;
    font-weight: 500;
    font-style: italic;
}

.post-role {
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--role-color);
    background: color-mix(in srgb, var(--role-color) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--role-color) 35%, transparent);
    border-radius: 999px;
}

.post-body {
    min-width: 0;
    padding: 18px 22px 22px;
}

.post-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.post-date {
    font-size: 12px;
    color: #80848e;
}

.post-delete {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    color: #fca5a5;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.post-delete:hover {
    color: #ffffff;
    background: rgba(239, 68, 68, 0.8);
}

.post-delete svg {
    width: 15px;
    height: 15px;
}

.post-content {
    font-size: 14.5px;
    line-height: 1.7;
    color: #d5d7dc;
    overflow-wrap: anywhere;
}

.reply-box {
    margin-top: 24px;
    padding: 22px;
    background: rgba(0, 0, 0, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
}

.reply-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #a3a6ad;
}

.reply-notice a {
    font-weight: 600;
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.reply-notice svg {
    flex-shrink: 0;
    width: 17px;
    height: 17px;
}

.rich-editor {
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.rich-editor.is-focused {
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06);
}

.rich-editor.is-dragging {
    border-color: rgba(134, 239, 172, 0.5);
    border-style: dashed;
}

.rich-editor.is-uploading {
    cursor: progress;
}

.rich-toolbar {
    position: sticky;
    top: 64px;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px;
    background: rgba(36, 37, 41, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px 14px 0 0;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.rich-group {
    display: flex;
    gap: 2px;
    padding-right: 4px;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
}

.rich-group:last-child {
    border-right: none;
}

.rich-btn {
    position: relative;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    color: #c4c7cd;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.rich-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.rich-btn.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.16);
}

.rich-btn svg {
    width: 16px;
    height: 16px;
}

.rich-swatch {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 4px;
    height: 3px;
    border-radius: 2px;
}

.rich-palette {
    position: absolute;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(6, 26px);
    gap: 6px;
    padding: 10px;
    background: linear-gradient(145deg, rgba(48, 50, 55, 0.98) 0%, rgba(32, 33, 37, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
}

.rich-palette[hidden] {
    display: none;
}

.rich-palette-color {
    width: 26px;
    height: 26px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rich-palette-color:hover {
    transform: scale(1.15);
}

.rich-palette-custom {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: space-between;
    margin-top: 2px;
    font-size: 12px;
    color: #a3a6ad;
    cursor: pointer;
}

.rich-palette-custom input {
    width: 40px;
    height: 24px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
}

.rich-area {
    position: relative;
    min-height: 180px;
    max-height: 600px;
    overflow-y: auto;
    padding: 14px 16px;
    outline: none;
}

#reply + .rich-editor .rich-area {
    min-height: 120px;
}

.rich-area.is-empty::before {
    content: attr(data-placeholder);
    position: absolute;
    color: #6b6e75;
    pointer-events: none;
}

.rich-footer {
    display: flex;
    justify-content: flex-end;
    min-height: 0;
    padding: 0 12px;
}

.rich-status {
    padding: 0 0 8px;
    font-size: 12px;
    color: #a3a6ad;
}

.rich-status:empty {
    display: none;
}

.rich-status.is-error {
    color: #fca5a5;
}

.rich-status.is-success {
    color: #86efac;
}

.rich-content,
.rich-area {
    font-size: 14.5px;
    line-height: 1.7;
    color: #d5d7dc;
    overflow-wrap: anywhere;
}

.rich-content > *:first-child,
.rich-area > *:first-child {
    margin-top: 0;
}

.rich-content p,
.rich-content div,
.rich-area p,
.rich-area div {
    margin: 0;
}

.rich-content h2,
.rich-area h2 {
    margin: 16px 0 6px;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    color: #ffffff;
}

.rich-content h3,
.rich-area h3 {
    margin: 14px 0 4px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    color: #ffffff;
}

.rich-content strong,
.rich-area strong,
.rich-area b {
    font-weight: 700;
    color: #ffffff;
}

.rich-content ul,
.rich-content ol,
.rich-area ul,
.rich-area ol {
    margin: 8px 0;
    padding-left: 24px;
}

.rich-content blockquote,
.rich-area blockquote {
    margin: 10px 0;
    padding: 8px 14px;
    color: #c4c7cd;
    background: rgba(255, 255, 255, 0.04);
    border-left: 3px solid rgba(255, 255, 255, 0.25);
    border-radius: 0 10px 10px 0;
}

.rich-content a,
.rich-area a {
    color: #93c5fd;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.rich-content img,
.rich-area img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 10px 0;
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
}

@media (max-width: 640px) {
    .rich-toolbar {
        top: 56px;
    }

    .thread-row {
        grid-template-columns: auto 1fr;
    }

    .thread-stats {
        display: none;
    }

    .post {
        grid-template-columns: 1fr;
    }

    .post-author {
        flex-direction: row;
        justify-content: flex-start;
        padding: 14px 16px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .post-avatar {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }
}
