.forums-wrapper {
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
}

.forums-wrapper.sidebar-open {
    margin-left: 260px;
}

.forums-container {
    max-width: 1100px;
    margin: 80px auto 40px;
    padding: 0 20px 20px;
}

@media (max-width: 767px) {
    .forums-wrapper.sidebar-open {
        margin-left: 0;
    }
}

.forums-header {
    margin-bottom: 24px;
    padding: 24px 0 0;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.forums-title {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    letter-spacing: -0.5px;
}

.forums-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.forums-nav {
    display: flex;
    gap: 2px;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-btn {
    background: transparent;
    color: #a0a0a0;
    border: none;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.nav-btn.active {
    background: #4a9eff;
    color: #fff;
    box-shadow: 0 2px 4px rgba(74, 158, 255, 0.3);
}

.forums-search {
    flex: 1;
    max-width: 400px;
    position: relative;
    display: flex;
    align-items: center;
}

.forums-search i {
    position: absolute;
    left: 14px;
    color: #a0a0a0;
    font-size: 14px;
    pointer-events: none;
}

.forums-search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 14px 10px 38px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.forums-search input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #4a9eff;
}

.forums-search input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.category-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #a0a0a0;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: all 0.2s;
}

.category-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.category-tab.active {
    background: rgba(74, 158, 255, 0.15);
    border-color: #4a9eff;
    color: #4a9eff;
}

.category-tab i {
    font-size: 14px;
}

.new-topic-btn {
    background: #4a9eff;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.3);
}

.new-topic-btn:hover {
    background: #3a8eef;
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.4);
    transform: translateY(-1px);
}

.new-topic-btn:active {
    transform: translateY(0);
}

.topics-list {
    background: rgba(30, 35, 50, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
}

.topic-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    border-left: 3px solid transparent;
}

.topic-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--category-color, transparent);
    opacity: 0.8;
}

.topic-row[data-category*="code"]::before {
    background: #10b981;
}

.topic-row[data-category*="tpack"]::before {
    background: #f59e0b;
}

.topic-row[data-category*="build"]::before {
    background: #3b82f6;
}

.topic-row[data-category*="schematic"]::before {
    background: #8b5cf6;
}

.topic-row:hover {
    background: rgba(74, 158, 255, 0.05);
    border-left-color: #4a9eff;
}

.topic-row:hover::before {
    opacity: 0;
}

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

.topic-row.read {
    opacity: 0.6;
}

.topic-row.read .topic-title {
    color: #a0a0a0;
    font-weight: 500;
}

.topic-row.read:hover {
    opacity: 0.8;
}

.topic-row.unread .topic-title {
    font-weight: 600;
}

.topic-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.topic-main {
    flex: 1;
    min-width: 0;
}

.topic-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.topic-status-icon {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.topic-status-icon.solved {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.topic-status-icon.solved::before {
    content: '✓';
    font-size: 12px;
}

.topic-status-icon.unsolved {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.topic-status-icon.unsolved::before {
    content: '?';
    font-size: 12px;
}

.topic-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.topic-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #a0a0a0;
}

.topic-author {
    display: flex;
    align-items: center;
    gap: 6px;
}

.topic-tags {
    display: flex;
    gap: 6px;
}

.topic-tag {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.topic-tag[data-category*="code"] {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.topic-tag[data-category*="tpack"] {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.topic-tag[data-category*="build"] {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.topic-tag[data-category*="schematic"] {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.topic-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
    flex-shrink: 0;
}

.topic-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 50px;
}

.topic-stat-number {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.topic-stat-label {
    font-size: 10px;
    color: #a0a0a0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.topic-activity {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 140px;
    flex-shrink: 0;
}

.topic-last-user {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #a0a0a0;
}

.topic-last-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.topic-last-time {
    font-size: 11px;
    color: #a0a0a0;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #a0a0a0;
}

.loading-more-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #a0a0a0;
}

.loading-more-state p {
    margin: 0;
    font-size: 14px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.loading-more-state .loading-spinner {
    width: 32px;
    height: 32px;
    border-width: 2px;
    margin-bottom: 12px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #a0a0a0;
    text-align: center;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.thread-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
}

.thread-modal.active {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    opacity: 1;
    visibility: visible;
}

.thread-modal-content {
    background: #1a1f2e;
    border: 1px solid rgba(74, 158, 255, 0.15);
    border-radius: 8px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.95) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.thread-modal.active .thread-modal-content {
    transform: scale(1) translateY(0);
}

.composer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}

.composer-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.composer-title i {
    color: #4a9eff;
    font-size: 18px;
}

.composer-close {
    background: transparent;
    border: none;
    color: #a0a0a0;
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s;
}

.composer-close:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.composer-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex: 1;
}

.composer-body::-webkit-scrollbar {
    width: 8px;
}

.composer-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.composer-body::-webkit-scrollbar-thumb {
    background: rgba(74, 158, 255, 0.3);
    border-radius: 4px;
}

.composer-body::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 158, 255, 0.5);
}

.composer-field {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.composer-editor-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    border-bottom: none;
}

.thread-title-input {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(74, 158, 255, 0.2);
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 17px;
    font-weight: 500;
    color: #fff;
    outline: none;
    transition: all 0.2s;
}

.thread-title-input:focus {
    border-color: #4a9eff;
    background: rgba(74, 158, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.thread-title-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.thread-tags-select label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #4a9eff;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tags-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag-option {
    background: rgba(255, 255, 255, 0.05);
    color: #a0a0a0;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tag-option:hover {
    background: rgba(74, 158, 255, 0.1);
    color: #fff;
    border-color: rgba(74, 158, 255, 0.3);
    transform: translateY(-1px);
}

.tag-option.selected {
    background: rgba(74, 158, 255, 0.2);
    color: #4a9eff;
    border-color: #4a9eff;
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.thread-editor {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.editor-toolbar {
    background: rgba(74, 158, 255, 0.05);
    border: 2px solid rgba(74, 158, 255, 0.2);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 10px;
    display: flex;
    gap: 6px;
}

.editor-btn {
    background: transparent;
    color: #a0a0a0;
    border: none;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.thread-content-input {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(74, 158, 255, 0.2);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 14px 18px;
    font-size: 15px;
    line-height: 1.6;
    color: #fff;
    outline: none;
    resize: vertical;
    font-family: inherit;
    transition: all 0.2s;
}

.thread-content-input:focus {
    border-color: #4a9eff;
    background: rgba(74, 158, 255, 0.08);
}

.thread-content-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.thread-modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 8px;
}

.thread-cancel-btn {
    background: transparent;
    color: #a0a0a0;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 11px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.thread-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.thread-submit-btn {
    background: linear-gradient(135deg, #4a9eff 0%, #3a7edf 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

.thread-submit-btn:hover {
    background: linear-gradient(135deg, #3a8eef 0%, #2a6ecf 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 158, 255, 0.4);
}

.thread-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.3);
}

@media (max-width: 968px) {
    .topic-row {
        grid-template-columns: 40px 1fr auto;
        gap: 12px;
    }

    .topic-stats {
        display: none;
    }

    .topic-activity {
        min-width: 80px;
    }
}

@media (max-width: 768px) {
    .forums-container {
        margin-top: 70px;
        padding: 0 12px 100px;
    }

    .forums-header {
        padding: 16px 0 0;
    }

    .header-top {
        margin-bottom: 16px;
    }

    .forums-title {
        font-size: 26px;
    }

    .new-topic-btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .new-topic-btn span {
        display: none;
    }

    .forums-controls {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 12px;
    }

    .forums-search {
        max-width: none;
        width: 100%;
    }

    .forums-nav {
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .forums-nav::-webkit-scrollbar {
        display: none;
    }

    .nav-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .category-tabs {
        gap: 6px;
    }

    .category-tab {
        padding: 8px 12px;
        font-size: 12px;
    }

    .topic-row {
        display: grid;
        grid-template-columns: 32px 1fr auto;
        grid-template-rows: auto auto;
        gap: 8px 10px;
        padding: 12px;
        align-items: center;
    }

    .topic-row::before {
        width: 3px;
    }

    .topic-avatar {
        width: 32px;
        height: 32px;
        grid-row: 1 / 3;
    }

    .topic-main {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
    }

    .topic-title-row {
        gap: 6px;
        margin-bottom: 4px;
    }

    .topic-status-icon {
        font-size: 9px;
        padding: 2px 5px;
    }

    .topic-title {
        font-size: 14px;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .topic-meta {
        gap: 6px;
        font-size: 10px;
    }

    .topic-tag {
        font-size: 9px;
        padding: 2px 6px;
    }

    .topic-stats {
        grid-column: 3;
        grid-row: 1;
        display: flex !important;
        flex-direction: column;
        gap: 4px;
        margin-left: 0;
        align-items: flex-end;
    }

    .topic-stat {
        flex-direction: row;
        gap: 4px;
        align-items: center;
        min-width: auto;
    }

    .topic-stat-number {
        font-size: 12px;
        font-weight: 600;
    }

    .topic-stat-label {
        font-size: 9px;
    }

    .topic-activity {
        grid-column: 2 / 4;
        grid-row: 2;
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        min-width: auto;
        gap: 8px;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }

    .topic-last-user {
        font-size: 10px;
    }

    .topic-last-avatar {
        width: 14px;
        height: 14px;
    }

    .topic-last-time {
        font-size: 9px;
        margin-left: auto;
    }

    .thread-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .composer-header {
        padding: 14px 16px;
    }

    .composer-field {
        padding: 14px 16px;
    }
}


.composer-title-input {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 18px;
    font-weight: 500;
    color: #fff;
    outline: none;
    width: 100%;
}

.composer-title-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.composer-tags-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #a0a0a0;
}

.composer-tags-header i {
    color: #4a9eff;
}

.tags-hint {
    margin-left: auto;
    font-size: 12px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.3);
}

.composer-tags-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.composer-tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #a0a0a0;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.composer-tag i {
    font-size: 14px;
}

.composer-tag:hover {
    background: rgba(74, 158, 255, 0.1);
    border-color: rgba(74, 158, 255, 0.3);
    color: #fff;
}

.composer-tag.selected {
    background: rgba(74, 158, 255, 0.15);
    border-color: #4a9eff;
    color: #4a9eff;
}

.composer-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.toolbar-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 6px;
}

.toolbar-btn {
    background: transparent;
    border: none;
    color: #a0a0a0;
    padding: 8px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.toolbar-btn:active {
    background: rgba(255, 255, 255, 0.12);
}

.composer-textarea {
    background: transparent;
    border: none;
    padding: 16px 20px;
    font-size: 15px;
    line-height: 1.6;
    color: #fff;
    outline: none;
    resize: none;
    font-family: inherit;
    flex: 1;
    min-height: 200px;
}

.composer-textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.composer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

.composer-footer-left {
    display: flex;
    gap: 8px;
}

.composer-footer-right {
    display: flex;
    gap: 10px;
}

.composer-preview-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #a0a0a0;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.composer-preview-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.composer-cancel-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #a0a0a0;
    padding: 9px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.composer-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.composer-submit-btn {
    background: #4a9eff;
    border: none;
    color: white;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.3);
}

.composer-submit-btn:hover {
    background: #3a8eef;
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.4);
    transform: translateY(-1px);
}

.composer-submit-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .thread-modal {
        padding: 0;
        align-items: flex-end;
    }

    .thread-modal-content {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 12px 12px 0 0;
    }

    .composer-header {
        padding: 14px 16px;
    }

    .composer-field {
        padding: 14px 16px;
    }

    .composer-toolbar {
        padding: 8px 12px;
        overflow-x: auto;
    }

    .toolbar-divider {
        display: none;
    }

    .composer-textarea {
        padding: 14px 16px;
        min-height: 150px;
    }

    .composer-footer {
        padding: 12px 16px;
        padding-bottom: 80px;
        flex-wrap: wrap;
        gap: 10px;
        position: static;
    }

    .composer-footer-left {
        order: 2;
        width: 100%;
    }

    .composer-footer-right {
        order: 1;
        width: 100%;
        justify-content: flex-end;
    }

    .composer-preview-btn {
        width: 100%;
        justify-content: center;
    }

    .composer-submit-btn {
        flex: 1;
        justify-content: center;
    }

    .composer-cancel-btn {
        flex: 1;
        justify-content: center;
    }
}


.composer-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #4a9eff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.composer-title-input {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    outline: none;
    width: 100%;
    transition: all 0.2s;
}

.composer-title-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #4a9eff;
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.composer-title-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.composer-preview {
    padding: 16px 20px;
    font-size: 15px;
    line-height: 1.6;
    color: #fff;
    overflow-y: auto;
    flex: 1;
    min-height: 200px;
}

.composer-preview p {
    margin: 0 0 12px 0;
}

.composer-preview pre {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 12px;
    overflow-x: auto;
    margin: 4px 0;
}

.composer-preview code {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #a0f0a0;
}

.composer-preview blockquote {
    border-left: 3px solid #4a9eff;
    padding-left: 12px;
    margin: 4px 0;
    color: rgba(255, 255, 255, 0.8);
}

.composer-preview ul,
.composer-preview ol {
    margin: 4px 0;
    padding-left: 24px;
    list-style-position: outside;
}

.composer-preview ul {
    list-style-type: disc;
}

.composer-preview ol {
    list-style-type: decimal;
}

.composer-preview li {
    margin: 4px 0;
    line-height: 1.6;
}

.composer-preview img {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    margin: 4px 0;
    cursor: pointer;
}

.composer-preview strong {
    font-weight: 700;
}

.composer-preview em {
    font-style: italic;
}

.composer-preview a {
    color: #4a9eff;
    text-decoration: none;
}

.composer-preview a:hover {
    text-decoration: underline;
}

.composer-preview-btn.active {
    background: rgba(74, 158, 255, 0.15);
    border-color: #4a9eff;
    color: #4a9eff;
}

.pr eview-image-container {
    margin: 16px 0;
    padding: 12px;
    background: rgba(74, 158, 255, 0.05);
    border: 1px solid rgba(74, 158, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.preview-image-container:hover {
    background: rgba(74, 158, 255, 0.08);
    border-color: rgba(74, 158, 255, 0.3);
}

.preview-image-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #4a9eff;
}

.preview-image-size {
    margin-left: auto;
    color: rgba(255, 255, 255, 0.4);
}

.preview-image-wrapper {
    position: relative;
    max-width: 100%;
    max-height: 400px;
    overflow: hidden;
    border-radius: 6px;
}

.preview-image {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    display: block;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    cursor: pointer;
}

.preview-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
    opacity: 0;
    transition: all 0.2s;
}

.preview-image-container:hover .preview-image-overlay {
    background: rgba(0, 0, 0, 0.6);
    opacity: 1;
}

.preview-image-overlay i {
    font-size: 32px;
}

.preview-image-overlay span {
    font-size: 14px;
    font-weight: 500;
}

.image-preview-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.image-preview-lightbox.active {
    opacity: 1;
}

.image-preview-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
}

.image-preview-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1;
}

.image-preview-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.image-preview-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
}

.image-preview-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.composer-preview .preview-image {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: block;
    margin: 8px 0;
}

.composer-preview .preview-image:hover {
    opacity: 0.9;
    transform: scale(0.99);
}


.composer-discard-btn {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.composer-discard-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

.composer-preview del {
    text-decoration: line-through;
    opacity: 0.7;
}

.composer-preview h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 4px 0 2px 0;
}

.composer-preview h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 3px 0 1px 0;
}

.composer-preview h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 2px 0 1px 0;
}


@media (max-width: 768px) {
    .thread-modal {
        padding: 0;
        align-items: flex-end;
    }

    .thread-modal-content {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 16px 16px 0 0;
    }

    .composer-header {
        padding: 16px;
    }

    .composer-title {
        font-size: 15px;
    }

    .composer-field {
        padding: 12px 16px;
    }

    .composer-label {
        font-size: 11px;
    }

    .composer-title-input {
        font-size: 15px;
        padding: 10px 14px;
    }

    .composer-tags-header {
        font-size: 12px;
    }

    .composer-tag {
        padding: 6px 12px;
        font-size: 12px;
    }

    .composer-tag i {
        font-size: 12px;
    }

    .composer-toolbar {
        padding: 8px;
        overflow-x: auto;
        gap: 2px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .composer-toolbar::-webkit-scrollbar {
        display: none;
    }

    .toolbar-group {
        gap: 1px;
    }

    .toolbar-btn {
        padding: 8px;
        font-size: 15px;
        min-width: 36px;
    }

    .toolbar-divider {
        margin: 0 4px;
    }

    .composer-textarea {
        padding: 12px 16px;
        min-height: 180px;
        font-size: 15px;
    }

    .composer-footer {
        padding: 12px 16px;
        gap: 8px;
    }

    .composer-footer-left {
        flex: 1;
    }

    .composer-footer-right {
        display: flex;
        gap: 8px;
    }

    .composer-preview-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .composer-discard-btn {
        padding: 8px 10px;
    }

    .composer-cancel-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .composer-submit-btn {
        padding: 8px 18px;
        font-size: 13px;
    }

    .composer-submit-btn span {
        display: none;
    }

    .composer-submit-btn i {
        margin: 0;
    }
}


@media (max-width: 768px) {
    .composer-tags-list {
        grid-template-columns: repeat(2, 1fr);
    }
}


.composer-tags-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}
.composer-
error {
background: rgba(239, 68, 68, 0.1);
border: 1px solid rgba(239, 68, 68, 0.3);
border-radius: 6px;
padding: 10px 14px;
margin-top: 8px;
color: #ef4444;
font-size: 13px;
font-weight: 500;
display: flex;
align-items: center;
gap: 8px;
animation: errorSlideIn 0.3s ease;
}

.composer-error::before {
content: '⚠';
font-size: 16px;
}

@keyframes errorSlideIn {
from {
opacity: 0;
transform: translateY(-10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}

.thread-modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0);
backdrop-filter: blur(0px);
display: none;
align-items: center;
justify-content: center;
z-index: 99999;
padding: 20px;
transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.thread-modal.active {
display: flex;
background: rgba(0, 0, 0, 0.8);
backdrop-filter: blur(4px);
}

.thread-modal.active .thread-modal-content {
animation: modalSlideIn 0.3s ease;
}

.thread-modal.closing {
background: rgba(0, 0, 0, 0);
backdrop-filter: blur(0px);
}

.thread-modal.closing .thread-modal-content {
animation: modalSlideOut 0.3s ease;
}

@keyframes modalSlideIn {
from {
opacity: 0;
transform: translateY(-20px) scale(0.95);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
}
}

@keyframes modalSlideOut {
from {
opacity: 1;
transform: translateY(0) scale(1);
}
to {
opacity: 0;
transform: translateY(-20px) scale(0.95);
}
}

.thread-modal-content {
background: rgba(30, 35, 50, 0.95);
backdrop-filter: blur(20px);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 12px;
width: 100%;
max-width: 800px;
max-height: 90vh;
overflow-y: auto;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.composer-error {
color: rgba(239, 68, 68, 0.9);
font-size: 12px;
font-weight: 400;
margin-top: 6px;
display: flex;
align-items: center;
gap: 4px;
animation: errorFadeIn 0.2s ease;
}
.composer-error::before {
content: '*';
font-size: 14px;
font-weight: 600;
}
@keyframes errorFadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
