.article-page {
    min-height: 100vh;
    background: var(--body-bg);
    padding: 0;
}

.editor-container {
    max-width: 840px;
    margin: 40px auto 40px;
    padding: 0 20px;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.editor-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.editor-actions {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
}

.btn-primary {
    background: var(--button-primary-bg);
    color: var(--button-primary-text);
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: var(--button-secondary-bg);
    color: var(--text-primary);
    border: 1px solid var(--post-border);
}

.btn-secondary:hover {
    background: var(--sidebar-bg);
    transform: translateY(-2px);
}

.btn svg {
    width: 18px;
    height: 18px;
}

.editor-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    font-size: 16px;
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.article-title-input {
    font-size: 26px;
    font-weight: 700;
    padding: 16px;
    border-width: 2px;
}

.counter {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: right;
    margin-top: 4px;
}

.counter.warning {
    color: var(--warning-color);
}

.counter.error {
    color: var(--error-color);
}

.cover-upload {
    position: relative;
    margin-bottom: 24px;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.cover-preview {
    position: relative;
    width: 100%;
    height: 400px;
    background: var(--sidebar-bg);
    border-radius: 12px;
    overflow: hidden;
}

.cover-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.upload-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--input-bg);
    border: 2px dashed var(--input-border);
    transition: all 0.3s ease;
}

.upload-placeholder:hover {
    background: var(--sidebar-bg);
    border-color: var(--accent-color);
}

.upload-placeholder svg {
    margin-bottom: 16px;
    width: 48px;
    height: 48px;
    stroke: var(--accent-color);
}

.upload-placeholder span {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.remove-cover {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    transition: all 0.3s ease;
    z-index: 10;
}

.remove-cover:hover {
    background: var(--error-color);
    transform: scale(1.1);
}

.article-editor-wrapper {
    border: 2px solid var(--input-border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--input-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--input-border);
    align-items: center;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.toolbar-btn:hover {
    background: var(--input-bg);
    color: var(--text-primary);
}

.toolbar-btn:active {
    transform: scale(0.95);
}

.toolbar-btn.active {
    background: var(--input-bg);
    color: var(--accent-color);
}

.toolbar-dropdown {
    position: relative;
}

.toolbar-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 120px;
    height: 38px;
    padding: 0 12px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    justify-content: space-between;
}

.toolbar-dropdown-btn:hover {
    border-color: var(--accent-color);
}

.toolbar-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 180px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    margin-top: 4px;
    padding: 8px 0;
    display: none;
}

.toolbar-dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 16px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: var(--sidebar-bg);
    color: var(--accent-color);
}

.toolbar-separator {
    width: 1px;
    height: 24px;
    background: var(--input-border);
    margin: 0 4px;
}

.article-editor-content {
    min-height: 500px;
    padding: 20px;
    color: var(--text-primary);
    font-size: 17px;
    line-height: 1.6;
    outline: none;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.article-editor-content *::selection {
    background-color: rgba(52, 152, 219, 0.2) !important;
    color: var(--text-primary) !important;
}

.article-editor-content h1,
.article-editor-content h2,
.article-editor-content h3,
.article-editor-content h4,
.article-editor-content h5,
.article-editor-content h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.article-editor-content h1 { font-size: 32px; }
.article-editor-content h2 { font-size: 28px; }
.article-editor-content h3 { font-size: 24px; }
.article-editor-content h4 { font-size: 20px; }
.article-editor-content h5 { font-size: 18px; }
.article-editor-content h6 { font-size: 16px; }

.article-editor-content p {
    margin-bottom: 16px;
}

.article-editor-content ul,
.article-editor-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.article-editor-content li {
    margin-bottom: 8px;
}

.article-editor-content blockquote {
    margin: 20px 0;
    padding: 16px 24px;
    border-left: 4px solid var(--accent-color);
    background: var(--sidebar-bg);
    font-style: italic;
}

.article-editor-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

.article-editor-content figure {
    margin: 20px 0;
    text-align: center;
    border: 1px solid var(--post-border);
    border-radius: 8px;
    padding-bottom: 10px;
    background: var(--post-bg);
    overflow: hidden;
}

.article-editor-content figure img {
    margin: 0 0 10px;
    border-radius: 0;
    max-width: 100%;
}

.article-editor-content figcaption {
    font-size: 14px;
    color: var(--text-secondary);
    font-style: italic;
    padding: 0 10px;
    line-height: 1.4;
}

.article-editor-content a {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px solid var(--link-color);
}

.article-editor-content a:hover {
    opacity: 0.8;
}

/* Обёртка для таблиц */
.table-wrapper {
    position: relative;
    width: 100%;
    margin: 32px 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--post-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--post-border);
    transition: all 0.3s ease;
}

.table-wrapper:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Контролы таблицы */
.table-controls {
    display: flex;
    justify-content: flex-end;
    padding: 8px 12px;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--post-border);
}

.table-delete-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--post-border);
    border-radius: 6px;
    color: var(--error-color);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.table-delete-btn:hover {
    background: rgba(231, 76, 60, 0.1);
    border-color: var(--error-color);
    transform: translateY(-1px);
}

.table-delete-btn svg {
    width: 14px;
    height: 14px;
}

/* Таблицы в редакторе */
.article-editor-content table,
.article-editor-content .article-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: var(--input-bg);
}

.article-editor-content th,
.article-editor-content td {
    padding: 14px 16px;
    text-align: left;
    border: 1px solid var(--post-border);
    transition: all 0.2s ease;
}

.article-editor-content th {
    background: var(--sidebar-bg);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    border-bottom: 2px solid var(--post-border);
}

.article-editor-content tbody tr {
    transition: all 0.2s ease;
}

.article-editor-content tbody tr:hover {
    background: rgba(52, 152, 219, 0.05);
}

.article-editor-content th[contenteditable="true"]:focus,
.article-editor-content td[contenteditable="true"]:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: -2px;
    background: rgba(52, 152, 219, 0.08);
    position: relative;
    z-index: 5;
}

.editor-footer {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--post-border);
}

.article-container {
    max-width: 840px;
    margin: 40px auto;
    padding: 0 20px;
}

.article-header {
    position: relative;
    z-index: 2;
    margin-bottom: 40px;
}

.article-title {
    font-size: 42px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 24px;
    color: var(--text-primary);
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 0;
    flex-wrap: wrap;
    justify-content: space-between;
}

.article-author {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--button-primary-bg));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--button-primary-text);
    font-weight: 600;
    font-size: 18px;
    flex-shrink: 0;
}

.author-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.author-name {
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.author-name:hover {
    color: var(--accent-color);
}

.article-date {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.article-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.action-btn {
    padding: 10px 18px;
    border-radius: 8px;
    background: var(--sidebar-bg);
    border: 1px solid var(--post-border);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none !important;
    white-space: nowrap;
}

.action-btn span {
    display: inline;
}

.action-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--button-primary-text);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-decoration: none !important;
}

.action-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.action-btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
}

.article-content {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-primary);
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    margin-top: 40px;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
}

/* Запрет редактирования контента в режиме просмотра */
.article-content * {
    -webkit-user-modify: read-only !important;
    -moz-user-modify: read-only !important;
    user-modify: read-only !important;
}

.article-content [contenteditable] {
    -webkit-user-modify: read-only !important;
    -moz-user-modify: read-only !important;
    user-modify: read-only !important;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin-top: 40px;
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.article-content h1 { font-size: 36px; }
.article-content h2 { font-size: 30px; }
.article-content h3 { font-size: 24px; }
.article-content h4 { font-size: 20px; }
.article-content h5 { font-size: 18px; }
.article-content h6 { font-size: 16px; }

.article-content p {
    margin-bottom: 24px;
}

.article-content a {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.article-content a:hover {
    border-bottom-color: var(--link-color);
}

.article-content img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 15px auto !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.article-content figure {
    margin: 15px auto !important;
    text-align: center;
}

.article-content figure img {
    margin: 0 0 10px !important;
}

.article-content img + img,
.article-content figure + img,
.article-content img + figure,
.article-content figure + figure {
    margin-top: 10px !important;
}

.article-content > *:first-child {
    margin-top: 0 !important;
}

.article-content > *:last-child {
    margin-bottom: 0 !important;
}

.article-content figcaption {
    font-size: 14px;
    color: var(--text-secondary);
    font-style: italic;
}

.article-content blockquote {
    margin: 32px 0;
    padding: 24px 32px;
    border-left: 4px solid var(--accent-color);
    background: var(--sidebar-bg);
    font-style: italic;
    font-size: 20px;
    color: var(--text-primary);
    border-radius: 0 12px 12px 0;
}

.article-content ul,
.article-content ol {
    margin-bottom: 24px;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 12px;
}

.article-content pre {
    background: var(--sidebar-bg);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 24px 0;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.5;
}

.article-content code {
    background: var(--sidebar-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
}

/* Таблицы в просмотре статьи */
.article-content .table-wrapper {
    margin: 32px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.article-content .table-wrapper::-webkit-scrollbar {
    height: 10px;
}

.article-content .table-wrapper::-webkit-scrollbar-track {
    background: var(--sidebar-bg);
    border-radius: 5px;
}

.article-content .table-wrapper::-webkit-scrollbar-thumb {
    background: var(--input-border);
    border-radius: 5px;
    transition: background 0.3s ease;
}

.article-content .table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

.article-content table,
.article-content .article-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 15px;
    background: var(--input-bg);
    min-width: 600px;
}

.article-content th,
.article-content td {
    padding: 14px 16px;
    text-align: left;
    border: 1px solid var(--post-border);
    cursor: default;
}

/* Полный запрет редактирования таблиц в режиме просмотра */
.article-content th[contenteditable],
.article-content td[contenteditable] {
    -webkit-user-modify: read-only !important;
    -moz-user-modify: read-only !important;
    user-modify: read-only !important;
    pointer-events: none;
}

.article-content th {
    background: var(--sidebar-bg);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    border-bottom: 2px solid var(--post-border);
}

.article-content tbody tr:hover {
    background: rgba(52, 152, 219, 0.05);
}

/* Скрываем контролы при просмотре статьи */
.article-content .table-controls {
    display: none !important;
}

.article-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--post-border);
    display: flex;
    justify-content: center;
    margin-bottom: 0;
}

.article-stats {
    display: flex;
    align-items: center;
    gap: 32px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
}

.stat-item svg {
    color: var(--text-secondary);
    width: 20px;
    height: 20px;
}

.spinner-small {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.publish-type-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.publish-type-option {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.publish-type-option:hover {
    border-color: var(--accent-color);
    background: var(--sidebar-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.publish-type-option.active {
    border-color: var(--accent-color);
    background: var(--sidebar-bg);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.publish-type-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.publish-type-option.active .publish-type-icon {
    background: linear-gradient(135deg, var(--accent-color), var(--button-primary-bg));
}

.publish-type-info {
    flex: 1;
}

.publish-type-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.publish-type-description {
    font-size: 14px;
    color: var(--text-secondary);
}

.publish-type-check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--input-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 4px;
}

.publish-type-option.active .publish-type-check {
    background: var(--accent-color);
    color: white;
}

#communitySelectGroup {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.community-selector-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    font-size: 16px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.community-selector-btn:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.selected-community {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.community-preview {
    display: flex;
    align-items: center;
    gap: 12px;
}

.community-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.community-avatar-placeholder-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--button-primary-bg));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 700;
}

.community-name-preview {
    font-weight: 500;
    color: var(--text-primary);
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.community-placeholder {
    color: var(--text-secondary);
}

.community-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.community-selector-modal.show {
    display: flex;
}

.community-selector-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.community-selector-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    background: var(--post-bg);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.community-selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid var(--post-border);
    flex-shrink: 0;
}

.community-selector-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.close-selector-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.close-selector-btn:hover {
    background: var(--sidebar-bg);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.community-selector-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.community-selector-list::-webkit-scrollbar {
    width: 8px;
}

.community-selector-list::-webkit-scrollbar-track {
    background: var(--sidebar-bg);
    border-radius: 4px;
}

.community-selector-list::-webkit-scrollbar-thumb {
    background: var(--input-border);
    border-radius: 4px;
}

.community-selector-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

.community-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    position: relative;
}

.community-item:hover {
    background: var(--sidebar-bg);
    border-color: var(--input-border);
}

.community-item.selected {
    background: rgba(52, 152, 219, 0.1);
    border-color: var(--accent-color);
}

.community-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.community-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--button-primary-bg));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.community-info {
    flex: 1;
    min-width: 0;
}

.community-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.community-slug {
    font-size: 14px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.community-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--input-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.community-item.selected .community-check {
    background: var(--accent-color);
    color: white;
}

.community-selector-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--post-border);
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

.article-menu-wrapper {
    position: relative;
}

.article-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--post-bg);
    border: 1px solid var(--post-border);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.article-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    font-size: 15px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.dropdown-menu-item:first-child {
    border-radius: 12px 12px 0 0;
}

.dropdown-menu-item:last-child {
    border-radius: 0 0 12px 12px;
}

.dropdown-menu-item:only-child {
    border-radius: 12px;
}

.dropdown-menu-item:hover {
    background: var(--sidebar-bg);
}

.dropdown-menu-item svg {
    flex-shrink: 0;
    color: var(--text-secondary);
}

.dropdown-menu-item:hover svg {
    color: var(--text-primary);
}

.dropdown-menu-item-danger {
    color: var(--error-color);
}

.dropdown-menu-item-danger svg {
    color: var(--error-color);
}

.dropdown-menu-item-danger:hover {
    background: rgba(231, 76, 60, 0.1);
}

.dropdown-menu-item-warning {
    color: var(--warning-color, #f39c12);
}

.dropdown-menu-item-warning svg {
    color: var(--warning-color, #f39c12);
}

.dropdown-menu-item-warning:hover {
    background: rgba(243, 156, 18, 0.1);
}

.dropdown-menu-divider {
    height: 1px;
    background: var(--post-border);
    margin: 4px 0;
}

/* Улучшенная адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .article-page {
        padding: 0;
    }
    
    .editor-container,
    .article-container {
        margin: 20px auto;
        padding: 0 16px;
    }
    
    .editor-header h1 {
        font-size: 24px;
    }
    
    .article-title {
        font-size: 28px;
        margin-bottom: 20px;
        line-height: 1.3;
    }
    
    .article-meta {
        gap: 8px;
        flex-wrap: nowrap;
    }
    
    .article-author {
        flex: 1;
        min-width: 0;
    }
    
    .author-avatar,
    .author-placeholder {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .author-info {
        min-width: 0;
        overflow: hidden;
    }
    
    .author-name {
        font-size: 15px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .article-date {
        font-size: 13px;
    }
    
    .article-actions {
        gap: 6px;
        flex-shrink: 0;
    }
    
    .action-btn {
        padding: 8px;
        width: 40px;
        height: 40px;
        justify-content: center;
        background: var(--sidebar-bg);
        border: 1px solid var(--post-border);
    }
    
    .action-btn span {
        display: none;
    }
    
    .action-btn svg {
        width: 18px;
        height: 18px;
        margin: 0;
    }
    
    .action-btn:hover {
        background: var(--accent-color);
        border-color: var(--accent-color);
        transform: none;
        box-shadow: none;
    }
    
    .action-btn:hover svg {
        color: var(--button-primary-text);
    }
    
    .action-btn-icon {
        width: 40px;
        height: 40px;
    }
    
    .article-dropdown-menu {
        right: 0;
        left: auto;
        min-width: 200px;
    }
    
    .article-content {
        font-size: 16px;
        line-height: 1.7;
        margin-top: 24px;
    }
    
    .article-content h1 { font-size: 26px; margin-top: 32px; }
    .article-content h2 { font-size: 24px; margin-top: 28px; }
    .article-content h3 { font-size: 20px; margin-top: 24px; }
    .article-content h4 { font-size: 18px; margin-top: 20px; }
    .article-content h5 { font-size: 16px; margin-top: 20px; }
    .article-content h6 { font-size: 15px; margin-top: 20px; }
    
    .article-content p {
        margin-bottom: 20px;
    }
    
    .article-content blockquote {
        margin: 24px 0;
        padding: 16px 20px;
        font-size: 17px;
    }
    
    .article-content img {
        border-radius: 8px;
        margin: 20px auto !important;
    }
    
    .table-wrapper {
        margin: 24px 0;
        border-radius: 8px;
    }
    
    .table-controls {
        padding: 6px 10px;
    }
    
    .table-delete-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .table-delete-btn svg {
        width: 12px;
        height: 12px;
    }
    
    /* Уменьшаем таблицы на мобильных без скролла */
    .article-content table,
    .article-content .article-table,
    .article-editor-content table,
    .article-editor-content .article-table {
        font-size: 11px;
        min-width: auto;
        width: 100%;
    }
    
    .article-content th,
    .article-content td,
    .article-editor-content th,
    .article-editor-content td {
        padding: 8px 6px;
        min-width: auto;
        word-break: break-word;
    }
    
    .article-content th,
    .article-editor-content th {
        font-size: 10px;
    }
    
    .article-stats {
        gap: 20px;
    }
    
    .stat-item {
        font-size: 14px;
    }
    
    .cover-preview {
        height: 250px;
    }
    
    .article-title-input {
        font-size: 22px;
        padding: 12px;
    }
    
    .article-editor-content {
        padding: 16px;
        font-size: 16px;
        min-height: 400px;
    }
    
    .toolbar-btn {
        width: 36px;
        height: 36px;
    }
    
    .toolbar-dropdown-btn {
        min-width: 100px;
        height: 36px;
        padding: 0 10px;
        font-size: 13px;
    }
    
    .toolbar-dropdown-menu {
        width: 150px;
    }
    
    .editor-footer {
        gap: 10px;
        margin-top: 24px;
        padding-top: 20px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .btn svg {
        width: 16px;
        height: 16px;
    }
    
    .publish-type-option {
        padding: 12px;
        gap: 10px;
        align-items: flex-start;
    }
    
    .publish-type-icon {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }
    
    .publish-type-info {
        flex: 1;
        min-width: 0;
    }
    
    .publish-type-title {
        font-size: 14px;
    }
    
    .publish-type-description {
        font-size: 12px;
        line-height: 1.4;
    }
    
    .publish-type-check {
        width: 24px;
        height: 24px;
        flex-shrink: 0;
        margin-top: 2px;
    }
    
    .community-selector-content {
        max-width: 100%;
        max-height: 85vh;
        border-radius: 16px 16px 0 0;
        margin-top: auto;
    }
    
    .community-selector-modal {
        padding: 0;
        align-items: flex-end;
    }
    
    .community-selector-header {
        padding: 20px;
    }
    
    .community-selector-header h3 {
        font-size: 18px;
    }
    
    .community-item {
        padding: 12px;
    }
    
    .community-avatar,
    .community-avatar-placeholder {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }
    
    .community-name {
        font-size: 15px;
    }
    
    .community-slug {
        font-size: 13px;
    }
    
    .community-selector-footer {
        padding: 16px 20px;
    }
}

@media (max-width: 480px) {
    .editor-container,
    .article-container {
        margin: 16px auto;
        padding: 0 12px;
    }
    
    .article-title {
        font-size: 24px;
        margin-bottom: 16px;
    }
    
    .article-content {
        font-size: 15px;
    }
    
    .article-content h1 { font-size: 24px; }
    .article-content h2 { font-size: 22px; }
    .article-content h3 { font-size: 18px; }
    .article-content h4 { font-size: 17px; }
    
    .table-wrapper {
        margin: 20px 0;
    }
    
    .article-content table,
    .article-content .article-table,
    .article-editor-content table,
    .article-editor-content .article-table {
        font-size: 10px;
    }
    
    .article-content th,
    .article-content td,
    .article-editor-content th,
    .article-editor-content td {
        padding: 6px 4px;
    }
    
    .article-content th,
    .article-editor-content th {
        font-size: 9px;
    }
    
    .cover-preview {
        height: 200px;
    }
    
    .article-title-input {
        font-size: 20px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .publish-type-option {
        padding: 10px;
        gap: 8px;
    }
    
    .publish-type-icon {
        width: 36px;
        height: 36px;
    }
    
    .publish-type-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .publish-type-title {
        font-size: 13px;
    }
    
    .publish-type-description {
        font-size: 11px;
    }
    
    .publish-type-check {
        width: 20px;
        height: 20px;
        margin-top: 0;
    }
    
    .publish-type-check svg {
        width: 14px;
        height: 14px;
    }
    
    .toolbar-separator {
        display: none;
    }
}