:root {
    --bg-body: #eef2ff;
    --bg-post: #d6daf0;
    --bg-highlight: #c5c9e8;
    --border-color: #b7c5d9;
    --text-primary: #000040;
    --text-link: #34345c;
    --text-link-hover: #dd0000;
    --text-name: #117743;
    --text-title: #cc1105;
    --text-header: #800000;
    --text-greentext: #789922;
    --highlight-search: #ffff99;
    --accent: #4b6584;
    --font-family: Arial, Helvetica, sans-serif;
    --font-size-base: 1rem;
    --font-size-small: 0.9rem;
    --font-size-large: 1.1rem;
    --font-size-xlarge: 1.2rem;
    --spacing-xs: 2px;
    --spacing-sm: 4px;
    --spacing-md: 8px;
    --spacing-lg: 10px;
    --spacing-xl: 20px;
    --border-radius: 4px;
    --border-radius-round: 20px;
}

body { 
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    margin: var(--spacing-md);
    background: var(--bg-body);
    color: var(--text-primary);
}

.boxcontent {
    margin: 20px 0;
}

.board-category {
    margin-bottom: 30px;
}

.board-category h3 {
    color: var(--text-header);
    margin-bottom: 15px;
    font-size: var(--font-size-large);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.board-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
}

.board-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-post);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: background-color 0.2s;
}

.board-item:hover {
    background: var(--bg-highlight);
}

.board-code {
    font-weight: bold;
    color: var(--text-link);
    margin-right: 10px;
    min-width: 40px;
}

.board-name {
    flex: 1;
    color: var(--text-primary);
}

.board-stats {
    font-size: var(--font-size-small);
    color: #666;
    margin-left: 10px;
}

.clear-bug {
    clear: both;
}

.warning {
    color: #ff6600;
    font-weight: bold;
}


.thread-container {
    margin: 20px 0;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.thread { 
    margin: 0; 
    padding: 15px; 
    background: var(--bg-body); 
    border-bottom: 1px solid var(--border-color);
}

.thread-container .post {
    margin: 10px 15px;
    padding: 8px 12px;
    background: var(--bg-post);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: var(--font-size-small);
}

.thread-container .post:last-child {
    margin-bottom: 15px;
}

.omitted-posts {
    margin: 10px 15px;
    padding: 8px 12px;
    background: var(--bg-highlight);
    border-radius: var(--border-radius);
    font-size: var(--font-size-small);
    color: #666;
    text-align: center;
}

.omitted-posts a {
    color: var(--text-link);
    text-decoration: none;
    font-weight: 500;
}

.omitted-posts a:hover {
    color: var(--text-link-hover);
    text-decoration: underline;
}

.post { 
    margin: var(--spacing-xs) 0; 
    padding: var(--spacing-xs) var(--spacing-sm); 
    background: var(--bg-post); 
    border-top: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

a { 
    color: var(--text-link); 
    text-decoration: underline; 
}

a:hover { 
    color: var(--text-link-hover); 
}

.nav { 
    margin: var(--spacing-xl) 0; 
}


.search-form {
    margin: 0 0 20px 0;
}

.search-form form {
    display: flex;
    gap: 0;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.search-form input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: var(--font-size-base);
}

.search-form input[type="text"]:focus {
    outline: none;
}

.search-form select {
    padding: 10px 12px;
    border: none;
    border-left: 1px solid var(--border-color);
    background: var(--bg-highlight);
    color: var(--text-primary);
    font-size: var(--font-size-small);
    cursor: pointer;
}

.search-form select:focus {
    outline: none;
    background: var(--bg-post);
}

.search-form button {
    padding: 10px 12px;
    background: var(--bg-highlight);
    color: var(--text-primary);
    border: none;
    border-left: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: inherit;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    margin: 0;
}

.search-form button:hover {
    background: var(--bg-post);
}

.search-form button svg {
    opacity: 0.7;
}

.search-form button:hover svg {
    opacity: 1;
}


.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 20px 0 30px 0;
}

.stat-card {
    background: var(--bg-post);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    text-align: center;
    transition: background-color 0.2s;
}

.stat-card:hover {
    background: var(--bg-highlight);
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-header);
    margin-bottom: 4px;
}

.stat-label {
    font-size: var(--font-size-small);
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input, button { 
    padding: 5px; 
    margin: 2px;
    border-radius: var(--border-radius);
}

.thumbnail {
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
    border-radius: var(--border-radius);
}

.thumbnail:hover {
    border-color: #0066cc;
}

.full-image {
    border: 2px solid #0066cc;
    cursor: pointer;
    border-radius: var(--border-radius);
}

.op-image {
    float: left;
    margin-right: 10px;
}

.thread-clear {
    clear: both;
}

.thread-content {
    margin-left: 10px;
    overflow: hidden;
}

.op-text {
    margin: 5px 0;
    font-size: var(--font-size-small);
    color: var(--text-primary);
    line-height: 1.3;
}

.thread-meta {
    margin-top: 5px;
    font-size: var(--font-size-small);
    color: #666;
}


.post {
    margin: 6.5px 0;
    padding: 9px;
    background: var(--bg-post);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.post-info {
    margin-bottom: 5px;
}

.post-name {
    font-weight: bold;
    color: var(--text-name);
}

.post-trip {
    font-weight: normal;
    color: var(--text-name);
    margin-left: 2px;
}

.poster-uid {
    margin-left: 5px;
    font-size: var(--font-size-small);
}

.poster-id-colored {
    border-radius: var(--border-radius);
    padding: 0px 2px;
    cursor: pointer;
    font-weight: bold;
}

.country-flag {
    width: 16px;
    height: 11px;
    margin-left: var(--spacing-sm);
    vertical-align: middle;
}

.post-date {
    color: var(--text-primary);
    margin-left: 5px;
    font-size: var(--font-size-small);
}

.post-number {
    margin-left: 5px;
}

.post-number a {
    color: var(--text-link);
    text-decoration: none;
    font-size: var(--font-size-small);
}

.post-number a:hover {
    color: var(--text-link-hover);
    text-decoration: underline;
}

.backlinks {
    margin-left: 10px;
}

.backlink {
    color: #0066cc;
    text-decoration: none;
    margin-right: 5px;
    font-size: var(--font-size-small);
}

.backlink:hover {
    text-decoration: underline;
}

.post-images {
    margin: 5px 0;
}

.image-container {
    display: inline-block;
    margin-right: 5px;
    vertical-align: top;
}

.image-filename {
    font-size: var(--font-size-small);
    margin-bottom: 2px;
    word-break: break-all;
}

.image-filename a {
    color: var(--text-primary);
    text-decoration: underline;
}

.image-filename a:hover {
    color: var(--text-link-hover);
}

.post-content {
    margin-top: 5px;
}

.thread-title {
    font-weight: bold;
    color: var(--text-title);
    margin: 3px 0;
    font-size: var(--font-size-large);
}

.quotelink {
    color: var(--text-link-hover);
    text-decoration: none;
}

.quotelink:hover {
    text-decoration: underline;
}

.greentext {
    color: var(--text-greentext);
}

.search-highlight {
    background-color: var(--highlight-search);
    font-weight: bold;
}

.post.highlighted {
    background-color: var(--bg-highlight);
    border-color: var(--text-link);
}

.webm-placeholder {
    position: relative;
    display: inline-block;
}

.webm-notice {
    position: absolute;
    bottom: 2px;
    left: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 10px;
    text-align: center;
    padding: 2px;
    border-radius: var(--border-radius);
}

.post-preview {
    pointer-events: none;
    font-size: var(--font-size-base);
    background: var(--bg-post);
    border: 1px solid var(--border-color);
}

.post-preview .post {
    margin: 0;
    border: none;
    background: var(--bg-post);
}


.header {
    text-align: center;
    margin: 20px 0;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    margin-bottom: 10px;
}

.logo a {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-header);
    text-decoration: none;
}

.logo a:hover {
    color: var(--text-link-hover);
}


.main-nav {
    font-size: 14px;
}

.main-nav a {
    color: var(--text-link);
    text-decoration: none;
    margin: 0 2px;
}

.main-nav a:hover {
    color: var(--text-link-hover);
}


.feed-board-label {
    background: var(--bg-highlight);
    padding: 2px 5px;
    margin-left: 5px;
    font-size: 12px;
    border-radius: var(--border-radius);
}


.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: var(--bg-post);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.navigation h3 {
    margin: 0;
    font-size: var(--font-size-large);
    color: var(--text-header);
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-small);
}

.sort-options a {
    padding: 6px 12px;
    background: var(--bg-highlight);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-link);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

.sort-options a:hover {
    background: var(--bg-body);
    color: var(--text-link-hover);
}

.sort-options a.active {
    background: var(--accent);
    color: white;
    font-weight: bold;
    border-color: var(--accent);
}

.board-filters {
    background: var(--bg-post);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px 20px;
    margin: 0 0 20px 0;
}

.filter-label {
    font-weight: 600;
    color: var(--text-header);
    margin-bottom: 10px;
    font-size: var(--font-size-base);
}

.board-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.board-filter-btn {
    padding: 8px 16px;
    background: var(--bg-highlight);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-round);
    color: var(--text-link);
    text-decoration: none;
    font-size: var(--font-size-small);
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.board-filter-btn:hover {
    background: var(--bg-body);
    color: var(--text-link-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.board-filter-btn.active {
    background: var(--accent);
    color: white;
    font-weight: bold;
    border-color: var(--accent);
}

@media (max-width: 768px) {
    .navigation {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .sort-options {
        justify-content: center;
    }
    
    .board-buttons {
        justify-content: center;
    }
}


.archived-label {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    background-color: #b0914f;
    color: white;
    border-radius: var(--border-radius);
    font-size: 12px;
    font-weight: bold;
}


.thread-nav-top {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}


.thread-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-post);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.thread-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.thread-nav .nav-link {
    color: var(--text-link);
    text-decoration: none;
    padding: 6px 12px;
    background: var(--bg-highlight);
    border-radius: var(--border-radius);
    font-size: var(--font-size-small);
    transition: background-color 0.2s;
    border: 1px solid var(--border-color);
}

.thread-nav .nav-link:hover {
    background: var(--bg-body);
    color: var(--text-link-hover);
}

.thread-info {
    flex: 1;
    min-width: 200px;
}

.thread-info h1 {
    margin: 0;
    font-size: 1.4em;
    color: var(--text-header);
    font-weight: bold;
}

.thread-meta {
    display: flex;
    gap: 15px;
    margin-top: 5px;
    font-size: var(--font-size-small);
    color: #666;
}

.feed-thread-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 5px;
    font-size: var(--font-size-small);
    color: #666;
}

.thread-meta .post-count,
.feed-thread-meta .post-count {
    font-weight: 500;
}

.thread-meta .image-count,
.feed-thread-meta .image-count {
    font-weight: 500;
    color: #6a9bd1;
}

.thread-meta .unique-posters {
    font-weight: 500;
    color: #8ba446;
}

.thread-meta .board-name {
    font-weight: bold;
    color: var(--text-link);
}

.thread-actions {
    display: flex;
    align-items: center;
}

.gallery-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--accent) 0%, #5a789c 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.gallery-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #5a789c 0%, var(--accent) 100%);
}

.gallery-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.gallery-icon {
    font-size: 1.1em;
}


.board-nav-top {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.board-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-post);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.board-info {
    flex: 1;
    min-width: 200px;
}

.board-info h1 {
    margin: 0;
    font-size: 1.6em;
    color: var(--text-header);
    font-weight: bold;
}

.board-meta {
    display: flex;
    gap: 15px;
    margin-top: 5px;
    font-size: var(--font-size-small);
    color: #666;
    flex-wrap: wrap;
}

.board-meta .thread-count {
    font-weight: 500;
    color: var(--text-link);
}

.board-meta .post-count {
    font-weight: 500;
}

.board-meta .image-count {
    font-weight: 500;
    color: #6a9bd1;
}

.board-meta .page-info {
    font-weight: 500;
    color: #888;
}

.board-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.board-nav-bottom {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
    align-items: center;
}

.gallery-text {
    font-weight: 600;
    letter-spacing: 0.5px;
}


@media (max-width: 768px) {
    .thread-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .thread-nav {
        justify-content: center;
        order: 3;
    }
    
    .thread-info {
        order: 1;
        text-align: center;
    }
    
    .thread-actions {
        order: 2;
        justify-content: center;
        margin: 10px 0;
    }
    
    .board-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .board-nav {
        justify-content: center;
        order: 2;
    }
    
    .board-info {
        order: 1;
        text-align: center;
    }
    
    .board-meta {
        justify-content: center;
    }
}


.gallery-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
}

.gallery-overlay img,
.gallery-overlay video {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    cursor: pointer;
}

.gallery-overlay .close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    font-size: 16px;
    border-radius: var(--border-radius);
    color: #000;
    font-weight: bold;
}

.gallery-overlay .nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    border-radius: var(--border-radius);
    color: #000;
}

.gallery-overlay .nav-btn.nav-left {
    left: 20px;
}

.gallery-overlay .nav-btn.nav-right {
    right: 20px;
}

.gallery-overlay .counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 18px;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: var(--border-radius);
}



.search-image {
    flex-shrink: 0;
}

.search-thumbnail {
    max-width: 100px;
    max-height: 100px;
    border: 1px solid var(--border-color);
}

.search-content {
    flex: 1;
}

.thread-title-search {
    font-weight: bold;
    color: var(--text-title);
    margin-left: 10px;
}

.search-context {
    margin-left: 10px;
    color: #666;
    font-size: var(--font-size-small);
}

.search-thumbnail {
    max-width: 125px;
    max-height: 125px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.search-header {
    background: var(--bg-highlight);
    padding: 4px 8px;
    margin: -9px -9px 5px -9px;
    font-size: var(--font-size-small);
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.search-header a {
    color: var(--text-link);
    text-decoration: none;
    font-weight: 500;
}

.search-header a:hover {
    color: var(--text-link-hover);
    text-decoration: underline;
}

.image-md5 {
    font-size: var(--font-size-small);
    color: #999;
    margin-left: 5px;
}

.image-md5 a {
    color: var(--text-link);
    text-decoration: none;
}

.image-md5 a:hover {
    color: var(--text-link-hover);
    text-decoration: underline;
}


@media (prefers-color-scheme: dark) {
    :root {
        
        --bg-body: #1a1a1a;           
        --bg-post: #242424;           
        --bg-highlight: #2e2e2e;      
        --border-color: #3a3a3a;      
        --text-primary: #d4d4d4;      
        --text-link: #58a6ff;         
        --text-link-hover: #79c0ff;   
        --text-name: #7ee787;         
        --text-title: #ffa657;        
        --text-header: #ff7b72;       
        --text-greentext: #7ee787;    
        --highlight-search: #388bfd;  
        --accent: #58a6ff;            
    }

    
    .board-stats, .thread-meta, .board-meta, .stat-label, .omitted-posts {
        color: #8b949e;
    }

    
    .search-highlight {
        background-color: #1f6feb;
        color: #ffffff;
        padding: 1px 2px;
        border-radius: var(--border-radius);
    }

    
    .archived-label {
        background-color: #da7633;
        color: #ffffff;
    }

    
    .webm-notice {
        background: rgba(13, 17, 23, 0.95);
        color: #f0f6fc;
    }

    .gallery-overlay .close-btn,
    .gallery-overlay .nav-btn {
        background: rgba(22, 27, 34, 0.95);
        color: #f0f6fc;
        border: 1px solid #30363d;
    }

    .gallery-overlay .counter {
        background: rgba(13, 17, 23, 0.95);
        color: #f0f6fc;
    }
}