body {
    margin: 0;
    font-family: Verdana, Arial, sans-serif;
    font-size: 13px;
    color: #222;
    background: #e8e8e8;
}
a { color: #003399; }

.wrap {
    max-width: 1000px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
}
.header {
    background: #003366;
    color: #fff;
    padding: 14px 20px;
}
.header .logo {
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    text-decoration: none;
}
.search-form {
    padding: 12px 20px;
    background: #f0f0f0;
    border-bottom: 1px solid #ddd;
}
.search-form input[type="text"] {
    width: 300px;
    padding: 5px;
}
.search-form input[type="submit"] {
    padding: 5px 15px;
}

.layout { display: flex; }
.sidebar {
    width: 220px;
    padding: 15px;
    background: #f7f7f7;
    border-right: 1px solid #ddd;
}
.main { flex: 1; padding: 15px 20px; min-width: 0; }

.category-tree, .category-tree ul {
    list-style: none;
    margin: 0;
    padding-left: 14px;
}
.category-tree { padding-left: 0; }
.category-tree a { display: block; padding: 2px 0; font-size: 12px; }
.category-tree a.active { font-weight: bold; color: #003366; }

.breadcrumb { font-size: 12px; color: #888; margin-bottom: 10px; }

.filters {
    background: #f7f7f7;
    border: 1px solid #ddd;
    padding: 10px 12px;
    margin-bottom: 15px;
    font-size: 12px;
}
.filters label { display: inline-block; margin-right: 12px; }
.filters input[type="text"] { width: 60px; }

.results-meta {
    color: #888;
    font-size: 12px;
    margin-bottom: 10px;
}

.image-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.image-tile {
    width: 220px;
    text-align: center;
    border: 1px solid #ddd;
    padding: 8px;
    background: #fafafa;
}
.image-tile img {
    max-width: 100%;
    max-height: 180px;
    display: block;
    margin: 0 auto 6px;
}
.image-tile .tile-title {
    font-size: 12px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.image-tile .tile-meta {
    font-size: 11px;
    color: #888;
}

.pagination { margin-top: 15px; }

.image-detail-full {
    text-align: center;
    margin-bottom: 15px;
}
.image-detail-full img {
    max-width: 100%;
    border: 1px solid #ccc;
}
.image-meta-table {
    border-collapse: collapse;
    font-size: 12px;
    margin-bottom: 15px;
}
.image-meta-table td {
    padding: 3px 10px 3px 0;
    color: #555;
}
.tag-list a {
    display: inline-block;
    background: #eee;
    padding: 2px 8px;
    margin: 0 4px 4px 0;
    font-size: 12px;
    text-decoration: none;
    color: #333;
}

@media (max-width: 700px) {
    .layout { flex-direction: column; }
    .sidebar { width: auto; border-right: none; border-bottom: 1px solid #ddd; }
}
