.board-gallery-page {
    --gallery-primary: #1aa7dd;
    --gallery-accent: #36c3ff;
    --gallery-ink: #e9f1fb;
    --gallery-muted: #9caabe;
    --gallery-line: #273449;
    --gallery-soft: #101827;
    color: var(--gallery-ink);
}

.gallery-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: .9rem;
    padding: 1.05rem 1.15rem;
    border: 1px solid var(--gallery-line);
    border-radius: 18px;
    background: linear-gradient(135deg, #101827 0%, #111f33 100%);
}

.gallery-eyebrow {
    margin: 0 0 .25rem;
    color: var(--gallery-accent);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.gallery-page-header h1 {
    margin: 0;
    color: #f1f6fd;
    font-size: clamp(1.55rem, 3vw, 2.15rem);
    font-weight: 800;
    letter-spacing: -.035em;
}

.gallery-description {
    max-width: 760px;
    margin: .55rem 0 0;
    color: var(--gallery-muted);
    font-size: .82rem;
    line-height: 1.45;
}

.gallery-home-link {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .45rem;
    padding: .6rem .8rem;
    border: 1px solid var(--gallery-line);
    border-radius: 10px;
    background: rgba(15,24,39,.82);
    color: #b8c6d9;
    font-size: .82rem;
    text-decoration: none;
}

.gallery-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .65rem;
}

.gallery-count {
    color: var(--gallery-muted);
    font-size: .86rem;
}

.gallery-count strong {
    color: var(--gallery-ink);
    font-size: 1.05rem;
}

.gallery-toolbar-actions,
.gallery-sort {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.gallery-sort {
    padding: .25rem;
    border: 1px solid var(--gallery-line);
    border-radius: 11px;
    background: var(--gallery-soft);
}

.gallery-sort a,
.gallery-tool-button,
.gallery-write-button {
    border: 0;
    border-radius: 8px;
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
}

.gallery-sort a {
    padding: .45rem .65rem;
    color: #9caabe;
}

.gallery-sort a.is-active {
    background: #1b2a3e;
    color: #66d4ff;
    box-shadow: 0 1px 4px rgba(0,0,0,.22);
}

.gallery-tool-button,
.gallery-write-button {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 38px;
    padding: .55rem .8rem;
}

.gallery-tool-button {
    border: 1px solid var(--gallery-line);
    background: #111b2a;
    color: #b8c6d9;
}

.gallery-write-button {
    background: #168fc1;
    color: #fff;
}

.gallery-search-panel {
    margin: 0 0 .8rem;
    padding: .78rem .85rem;
    border: 1px solid var(--gallery-line);
    border-radius: 14px;
    background: var(--gallery-soft);
}

.gallery-search-panel form {
    display: grid;
    grid-template-columns: minmax(140px, .7fr) minmax(220px, 2fr) auto;
    align-items: end;
    gap: .75rem;
}

.gallery-search-panel label {
    margin: 0;
    color: #aab7ca;
    font-size: .78rem;
    font-weight: 700;
}

.gallery-search-panel select,
.gallery-search-panel input {
    width: 100%;
    height: 42px;
    margin-top: .35rem;
    border: 1px solid #334158;
    border-radius: 9px;
    background: #0c1421;
    color: #edf4fc;
}

.gallery-search-panel button {
    height: 42px;
    padding: 0 1.1rem;
    border: 0;
    border-radius: 9px;
    background: #168fc1;
    color: #fff;
    font-weight: 700;
}

.gallery-notices {
    display: grid;
    grid-template-columns: 95px minmax(0, 1fr);
    margin-bottom: .8rem;
    border: 1px solid #24445a;
    border-radius: 14px;
    background: #0f1b29;
    overflow: hidden;
}

.gallery-notices h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    margin: 0;
    background: #13283a;
    color: #58c9f4;
    font-size: .86rem;
    font-weight: 800;
}

.gallery-notices ul {
    margin: 0;
    padding: .4rem 1rem;
    list-style: none;
}

.gallery-notices a {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .42rem 0;
    color: #c8d5e7;
    font-size: .84rem;
}

.gallery-notices time {
    flex: 0 0 auto;
    color: #8190a5;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .78rem;
}

.gallery-card {
    min-width: 0;
    border: 1px solid var(--gallery-line);
    border-radius: 16px;
    background: #0f1827;
    box-shadow: 0 5px 18px rgba(0,0,0,.18);
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.gallery-card:hover {
    transform: translateY(-3px);
    border-color: #3c6179;
    box-shadow: 0 12px 28px rgba(0,0,0,.3);
}

.gallery-card-media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    background: #111b29;
    overflow: hidden;
}

.gallery-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s ease;
}

.gallery-card:hover .gallery-card-media img {
    transform: scale(1.035);
}

.gallery-card-placeholder {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 25% 20%, rgba(54,195,255,.18), transparent 34%),
        linear-gradient(145deg, #152337, #101927);
    color: #52647c;
    font-size: 2rem;
}

.gallery-video-badge,
.gallery-notice-badge {
    position: absolute;
    top: .7rem;
    padding: .32rem .55rem;
    border-radius: 999px;
    color: #fff;
    font-size: .7rem;
    font-weight: 800;
    backdrop-filter: blur(4px);
}

.gallery-video-badge {
    right: .7rem;
    background: rgba(17,26,45,.82);
}

.gallery-notice-badge {
    left: .7rem;
    background: rgba(22,143,193,.92);
}

.gallery-card-body {
    padding: .8rem .82rem .72rem;
}

.gallery-card-flags {
    display: flex;
    flex-wrap: wrap;
    gap: .28rem;
    min-height: 1rem;
    margin-bottom: .2rem;
}

.gallery-card-flags span {
    color: #8fa0b8;
    font-size: .63rem;
    font-weight: 800;
}

.gallery-card-flags .is-danger { color: #ff7b8b; }
.gallery-card-flags .is-new { color: #54cfff; }

.gallery-card h2 {
    display: -webkit-box;
    min-height: 2.35rem;
    margin: 0 0 .3rem;
    overflow: hidden;
    color: #edf4fc;
    font-size: .91rem;
    font-weight: 800;
    line-height: 1.3;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.gallery-card h2 a { color: inherit; }
.gallery-card h2 small { margin-left: .25rem; color: #ff8492; font-size: .68rem; }

.gallery-card-body > p {
    display: -webkit-box;
    min-height: 5rem;
    margin: 0 0 .58rem;
    overflow: hidden;
    color: var(--gallery-muted);
    font-size: .72rem;
    line-height: 1.42;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.gallery-protected-copy { font-style: italic; }

.gallery-card footer {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding-top: .55rem;
    border-top: 1px solid #253247;
    color: #8291a7;
    font-size: .66rem;
}

.gallery-card footer time { margin-left: auto; }
.gallery-author { max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.gallery-empty {
    display: flex;
    min-height: 220px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: .5rem;
    border: 1px dashed #34435a;
    border-radius: 16px;
    color: #8b9ab0;
}

.gallery-empty i { font-size: 2rem; color: #52647c; }
.gallery-empty strong { color: #d9e4f2; }

.gallery-pagination {
    display: flex;
    justify-content: center;
    gap: .35rem;
    margin: 1rem 0 .25rem;
}

.gallery-pagination a {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gallery-line);
    border-radius: 9px;
    background: #111b2a;
    color: #aab7ca;
    font-size: .82rem;
    font-weight: 700;
}

.gallery-pagination a.is-current {
    border-color: #168fc1;
    background: #168fc1;
    color: #fff;
}

.gallery-pagination a.is-disabled {
    pointer-events: none;
    opacity: .4;
}

@media (max-width: 991.98px) {
    .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
    .gallery-page-header,
    .gallery-toolbar { align-items: stretch; flex-direction: column; }
    .gallery-page-header { gap: .85rem; }
    .gallery-description { -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
    .gallery-home-link { align-self: flex-start; }
    .gallery-toolbar-actions { flex-wrap: wrap; }
    .gallery-sort { flex: 1 1 100%; justify-content: space-between; }
    .gallery-search-panel form { grid-template-columns: 1fr; }
    .gallery-notices { grid-template-columns: 1fr; }
    .gallery-notices h2 { justify-content: flex-start; padding: .65rem 1rem; }
    .gallery-card-body { padding: .74rem .78rem .68rem; }
    .gallery-card h2 { min-height: 2.2rem; font-size: .89rem; }
    .gallery-card-body > p { min-height: 2.2rem; font-size: .7rem; }
    .gallery-card footer { gap: .5rem; }
}

@media (max-width: 575.98px) {
    .gallery-page-header { padding: .88rem .92rem; }
    .gallery-grid { grid-template-columns: 1fr; }
    .gallery-toolbar-actions { width: 100%; gap: .3rem; }
    .gallery-sort { padding: .2rem; }
    .gallery-sort a { padding: .4rem .5rem; font-size: .77rem; }
    .gallery-tool-button,
    .gallery-write-button { flex: 1; justify-content: center; min-height: 36px; padding: .48rem .65rem; }
    .gallery-card-media { aspect-ratio: 16 / 8.2; }
    .gallery-card-body { padding: .68rem .72rem .62rem; }
    .gallery-card h2 { min-height: 2.1rem; font-size: .86rem; }
    .gallery-card-body > p { -webkit-line-clamp: 2; min-height: 2.05rem; }
    .gallery-card footer { font-size: .64rem; }
}
