       /* ===== СВЕТЛАЯ ТЕМА (DEFAULT) ===== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #eeeeee;
    color: #222;
    margin: 0 auto;
    padding: 0;
    padding-top: 50px;
    line-height: 1.45;
    max-width: 800px;
}

header {
    margin-top: 30px;
    background-color: #fdf4e3;
    padding: 10px 15px;
    margin-bottom: 0;
}

.post {
    background: #dddddd;
    padding: 12px 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
}
.post-text {
    margin: 10px 0;
    word-wrap: break-word;
    color: black;
}

/* Стили для номера поста */
.post-id-link {
    color: grey;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.post-id-link:hover {
    text-decoration: underline;
    color: #800000 !important;
}

/* Подсветка поста при скролле к нему */
.post-highlight {
    animation: highlightPost 1s ease-in-out;
    border-radius: 5px;
}

@keyframes highlightPost {
    0% {
        background-color: rgba(120, 153, 34, 0.4);
        box-shadow: 0 0 0 0 rgba(120, 153, 34, 0.4);
    }
    50% {
        background-color: rgba(120, 153, 34, 0.2);
        box-shadow: 0 0 0 5px rgba(120, 153, 34, 0.2);
    }
    100% {
        background-color: rgba(120, 153, 34, 0);
        box-shadow: 0 0 0 0 rgba(120, 153, 34, 0);
    }
}

/* Для темной темы */
.dark-theme .post-id-link {
    color: #aaa;
}

.dark-theme .post-id-link:hover {
    color: #a8d04e !important;
}

.dark-theme .post-highlight {
    animation: highlightPostDark 1s ease-in-out;
}

@keyframes highlightPostDark {
    0% {
        background-color: rgba(168, 208, 78, 0.3);
        box-shadow: 0 0 0 0 rgba(168, 208, 78, 0.3);
    }
    100% {
        background-color: rgba(168, 208, 78, 0);
        box-shadow: 0 0 0 0 rgba(168, 208, 78, 0);
    }
}

/* Дополнительно: плавный скролл */
html {
    scroll-behavior: smooth;
}

/* Стиль для поста, на который навели */
.post {
    transition: background-color 0.2s ease;
}

a {
    color: #800000;
}

.post-link {
    color: #800000;
    text-decoration: none;
    cursor: pointer;
}

.post-link:hover {
    text-decoration: underline;
}

.dark-theme .post-link {
    color: #81c784;
}

.dark-theme .post-link:hover {
    color: #a5d6a7;
}

.post-text.collapsed {
    max-height: 150px;
    overflow: hidden;
    position: relative;
}

.post-text.collapsed::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(transparent, #dddddd);
}

.toggle-btn {
    background: none;
    border: none;
    color: #800000;
    cursor: pointer;
    padding: 2px 5px;
    font-size: 0.8em;
    margin-top: 5px;
}

.toggle-btn:hover {
    text-decoration: underline;
}

.media-files {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.media-files img, 
.media-files video {
    max-width: 350px;
    max-height: 350px;
    cursor: pointer;
    border: 1px solid #D9BFB7;
}

.image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
}

.image-modal-content {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    cursor: grab;
}

.image-modal-content:active {
    cursor: grabbing;
}

.post-replies {
    margin-top: 5px;
    font-size: 0.85em;
    color: gray;
}

.post-header {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.post-header small:first-child {
    cursor: pointer;
    user-select: none;
    color: gray !important;
}

.post-header small:first-child:hover {
    text-decoration: underline;
}

.search-highlight {
    background-color: yellow;
    color: black;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: bold;
}


.file-link {
    display: inline-block;
    padding: 5px 10px;
    background: #f0f0f0;
    border-radius: 3px;
    text-decoration: none;
    color: #333;
    margin: 5px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
    padding: 15px;
    background-color: #fdf4e3;
    border-radius: 8px;
    border: 1px solid #eee;
}

.pagination a {
    padding: 8px 16px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
}

.pagination a:hover {
    background-color: #f0f0f0;
    border-color: #ccc;
}

.page-jump {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 15px;
}

.page-input {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.page-btn {
    padding: 6px 12px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.page-btn:hover {
    background-color: #e0e0e0;
}

.search-form {
    margin: 10px 0;
    padding: 10px;
    background-color: #fdf4e3;
    border-radius: 5px;
}

.search-input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 250px;
}

.search-btn {
    padding: 8px 15px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.search-btn:hover {
    background-color: #45a049;
}

.search-clear {
    margin-left: 10px;
    padding: 8px 15px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.search-clear:hover {
    background-color: #d32f2f;
}

.search-results-info {
    margin: 10px 0;
    padding: 8px 12px;
    background-color: #e8f5e9;
    border-left: 4px solid #4CAF50;
    border-radius: 4px;
    font-size: 0.9em;
}

.post-link-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8em;
    text-decoration: none;
    display: inline-block;
    margin-left: 10px;
}

.post-link-btn:hover {
    background-color: #45a049;
    text-decoration: none;
    color: white;
}

.quote {
    color: #89a15f;
}

/* Изменения для уменьшения theme-bar */
#theme-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    padding: 3px 5px;
    display: flex;
    gap: 8px;
    z-index: 1000;
    border-bottom: 1px solid #ccc;
    justify-content: flex-end;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    align-items: center;
    height: 35px;
    box-sizing: border-box;
}

.bar-btn, 
#themeToggle {
    padding: 4px 8px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.bar-btn:hover, 
#themeToggle:hover {
    background: #e0e0e0;
}

.my-link {
    color: black;
    background-color: #eeeeee;
    padding: 10px;
    border-radius: 5px;
    font-size: 1.5rem;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.my-link:visited {
    color: black;
}

.archive-info {
    margin: 15px 0;
    padding: 10px;
    background-color: #fdf4e3;
    border-radius: 5px;
}

.archive-notice {
    margin-top: 10px;
    text-align: center;
}

/* ===== ТЁМНАЯ ТЕМА ===== */
/* Удаляем :root и CSS переменные, так как они не используются */

.dark-theme body {
    background: #2c2c2e;
    color: #ddd;
}

.dark-theme header {
    background-color: #3d2c1e;
}

.dark-theme .post {
    background: #43454a;
    color: #ddd;
}

.dark-theme .post-text {
    color: #ddd;
}

.dark-theme .post-text.collapsed::after {
    background: linear-gradient(transparent, #2a2a2a);
}

.dark-theme .toggle-btn {
    color: #ffb74d;
}

.dark-theme .media-files img,
.dark-theme .media-files video {
    border-color: #6d5d4e;
}

.dark-theme .pre-moderation-placeholder {
    border-color: #555;
}

.dark-theme .pre-moderation-content {
    background: #222;
    color: #ddd;
}

.dark-theme .pre-moderation-full-post {
    background: #2a2a2a;
    border-color: #555;
}

.dark-theme .pre-moderation-full-post .pre-moderation-content {
    color: #ccc;
}

.dark-theme .post-header small:first-child {
    color: #aaa !important;
}

.dark-theme .post-header small:first-child:hover {
    color: #fff;
}

.dark-theme .search-highlight {
    background-color: #ffeb3b;
    color: #000;
}

.dark-theme .file-link {
    background: #444;
    color: #fff;
}

.dark-theme .pagination {
    background-color: #2a2a2a;
    border-color: #444;
}

.dark-theme .pagination a {
    background-color: #333;
    border-color: #555;
    color: #ddd;
}

.dark-theme .pagination a:hover {
    background-color: #444;
    border-color: #666;
}

.dark-theme .page-input {
    background-color: #333;
    color: #fff;
    border-color: #555;
}

.dark-theme .page-btn {
    background-color: #444;
    color: #fff;
    border-color: #666;
}

.dark-theme .page-btn:hover {
    background-color: #555;
}

.dark-theme .search-form {
    background-color: #2a2a2a;
}

.dark-theme .search-input {
    background-color: #333;
    color: #fff;
    border-color: #555;
}

.dark-theme .search-btn {
    background-color: #2e7d32;
}

.dark-theme .search-btn:hover {
    background-color: #1b5e20;
}

.dark-theme .search-clear {
    background-color: #c62828;
}

.dark-theme .search-clear:hover {
    background-color: #b71c1c;
}

.dark-theme .search-results-info {
    background-color: #2c3e2c;
    border-left-color: #4CAF50;
    color: #e8f5e9;
}

.dark-theme .post-link-btn {
    background-color: #2e7d32;
}

.dark-theme .post-link-btn:hover {
    background-color: #1b5e20;
}

.dark-theme .quote {
    color: #81c784;
}

.dark-theme #theme-bar {
    background: rgba(40, 40, 40, 0.95);
    border-bottom-color: #555;
}

.dark-theme .bar-btn,
.dark-theme #themeToggle {
    background: #444;
    color: #fff;
    border-color: #666;
}

.dark-theme .bar-btn:hover,
.dark-theme #themeToggle:hover {
    background: #555;
}

.dark-theme .my-link {
    color: #ddd;
    background-color: #2a2a2a;
}

.dark-theme .archive-info {
    background-color: #2a2a2a;
    color: #fff;
}

/* ===== МЕДИА-ЗАПРОСЫ ===== */
@media (max-width: 768px) {
    .pre-moderation-content {
        width: 150px;
        height: 150px;
        font-size: 12px;
    }
    
    body {
        padding-top: 60px;
    }
    
    #theme-bar {
        height: 60px;
        padding: 8px 10px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .bar-btn, #themeToggle {
        font-size: 12px;
        padding: 5px 8px;
        height: 28px;
    }
    
    .post, .message-form {
        padding: 10px;
    }
    
    .media-files img, .media-files video {
        max-width: 150px;
        max-height: 150px;
    }
    
    .post-header {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 5px;
        font-size: 0.8em;
    }
    
    .page-jump {
        margin-left: 0;
        margin-top: 10px;
        justify-content: center;
        width: 100%;
    }
    
    .page-input {
        width: 50px;
    }
    
    .search-input {
        width: 200px;
    }
    
    .my-link {
        font-size: 1.2rem;
        padding: 8px 15px;
        display: block;
        margin: 0 auto;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 70px;
    }
    
    #theme-bar {
        height: 70px;
    }
    
    .bar-btn, #themeToggle {
        font-size: 11px;
        padding: 4px 6px;
    }
}

/* Стили для превью */
.post-preview {
    display: none;
    position: fixed;
    z-index: 9999;
    max-width: 800px;
    max-height: 600px;
    background: #f6f6f6;
    border: 1px solid #aaa;
    padding: 12px;
    font-size: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,.3);
    pointer-events: none;
    overflow-y: auto;
}

.post-preview:not(.hidden) {
    display: block;
}

.dark-theme .post-preview {
    background: #222;
    border-color: #444;
}

.post-preview img {
    max-width: 600px;
    max-height: 400px;
    display: block;
    margin-bottom: 8px;
}

.post-preview .pp-id {
    color: gray;
    font-size: 13px;
    margin-bottom: 8px;
    font-weight: bold;
}

.dark-theme .post-preview .pp-id {
    color: #aaa;
}

.post-preview .pp-content {
    max-height: 300px;
    overflow-y: auto;
    line-height: 1.4;
}
.bar-link {
    cursor: pointer;
    user-select: none;  /* Запрещает выделение текста */
    transition: opacity 0.2s;  /* Плавное изменение при наведении */
}

.bar-link:hover {
    opacity: 0.8;  /* Легкое затемнение при наведении */
    text-decoration: underline;  /* Подчеркивание при наведении (как у вас уже есть) */
}