:root {
    --bg-main: #140f1f;
    --bg-panel: #211635;
    --bg-panel-2: #2a1d44;
    --border: #ff4fd8;
    --border-soft: #6de6ff;
    --text-main: #f8f3ff;
    --text-soft: #d7cfff;
    --text-dim: #bdaed8;
    --accent: #ffe066;
    --accent-2: #6de6ff;
    --danger: #ff5d73;
    --success: #81f7b5;
    --shadow: 0 0 0 2px rgba(255,79,216,0.16), 0 14px 35px rgba(0,0,0,0.35);
    --radius: 20px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at top left, rgba(109,230,255,0.14), transparent 24%),
        radial-gradient(circle at top right, rgba(255,79,216,0.16), transparent 20%),
        linear-gradient(180deg, #100b19 0%, #1a1230 45%, #120d1e 100%);
    min-height: 100vh;
    line-height: 1.6;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: #fff49d;
}

.container {
    width: min(1180px, calc(100% - 28px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(10px);
    background: rgba(16, 11, 25, 0.9);
    border-bottom: 2px solid rgba(109, 230, 255, 0.22);
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 0;
}

.logo-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6de6ff, #ff4fd8);
    box-shadow: 0 0 16px rgba(109,230,255,0.35);
    position: relative;
}

.logo-icon::before,
.logo-icon::after {
    content: "";
    position: absolute;
    background: rgba(20, 15, 31, 0.95);
}

.logo-icon::before {
    width: 18px;
    height: 6px;
    left: 13px;
    top: 19px;
    border-radius: 999px;
}

.logo-icon::after {
    width: 6px;
    height: 18px;
    left: 19px;
    top: 13px;
    border-radius: 999px;
}

.logo {
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 79, 216, 0.35);
}

.logo-sub {
    display: block;
    font-size: 0.75rem;
    color: var(--accent-2);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.top-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.top-nav a {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid rgba(109,230,255,0.35);
    border-radius: 999px;
    background: rgba(42, 29, 68, 0.72);
    color: var(--text-main);
    font-size: 0.95rem;
}

.hero {
    padding: 30px 0 20px;
}

.hero-box,
.panel,
.form-box,
.empty-box,
.detail-box,
.light-panel {
    background: linear-gradient(180deg, rgba(33,22,53,0.98), rgba(26,18,48,0.98));
    border: 2px solid rgba(255,79,216,0.24);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}

.hero-box {
    position: relative;
    overflow: hidden;
}

.hero-box::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 16px 16px;
    pointer-events: none;
    opacity: 0.25;
}

.hero h1,
.page-title,
.error-code {
    margin: 0 0 10px;
    line-height: 1.08;
    font-size: clamp(2rem, 5vw, 3.2rem);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow:
        0 0 14px rgba(255,79,216,0.35),
        0 0 22px rgba(109,230,255,0.18);
}

.hero p,
.page-lead {
    margin: 0;
    max-width: 850px;
    color: var(--text-soft);
    font-size: 1.04rem;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    margin: 26px 0 18px;
}

.section-head h2,
.list-header {
    margin: 0;
    font-size: 1.4rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.muted {
    color: #cfc5ea;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.card {
    background: linear-gradient(180deg, rgba(33,22,53,0.98), rgba(26,18,48,0.98));
    border: 2px solid rgba(109,230,255,0.24);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--border);
}

.card-link-image {
    display: block;
    background: #0f0a17;
}

.card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.card-content {
    padding: 18px;
}

.card-content h2,
.card-content h3 {
    margin: 0 0 10px;
    font-size: 1.2rem;
    line-height: 1.2;
}

.card p {
    margin: 0;
    color: var(--text-soft);
}

.console-meta,
.tag-links,
.filter-row,
.admin-actions,
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.console-meta {
    margin: 0 0 14px;
}

.console-meta span,
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: #efe7ff;
    font-size: 0.88rem;
}

.tag-links {
    margin-top: 18px;
}

.tag-links a {
    display: inline-block;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(109,230,255,0.11);
    border: 1px solid rgba(109,230,255,0.28);
    color: #ecfbff;
    font-size: 0.9rem;
}

.read-more {
    margin-top: 16px;
}

.button,
button,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    border-radius: 12px;
    border: 0;
    background: linear-gradient(180deg, #ffe066, #ffb800);
    color: #281c05;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.button-secondary {
    background: linear-gradient(180deg, #8cf2ff, #49d4ff);
    color: #0b1b24;
}

.button-danger {
    background: linear-gradient(180deg, #ff7b90, #ff4d6d);
    color: #fff;
}

.button-ghost {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.12);
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 22px 0 18px;
    font-size: 0.95rem;
    color: var(--text-soft);
}

.breadcrumbs a {
    color: var(--accent-2);
}

.console-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 24px;
    align-items: start;
}

.console-cover {
    width: 100%;
    border-radius: 16px;
    border: 2px solid rgba(109,230,255,0.28);
    box-shadow: var(--shadow);
}

.console-description {
    margin-top: 18px;
    color: var(--text-soft);
}

.console-description p:first-child {
    margin-top: 0;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 26px;
}

.gallery-item {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    cursor: zoom-in;
}

.gallery-item p {
    margin: 0;
    padding: 12px;
    color: var(--text-soft);
}

.site-footer {
    padding: 34px 0 50px;
    color: #ccbfe8;
    font-size: 0.95rem;
}

input[type="text"],
input[type="password"],
input[type="number"],
textarea,
input[type="file"],
select {
    width: 100%;
    margin-top: 6px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.04);
    color: #fff;
}

input::placeholder,
textarea::placeholder {
    color: #b8aacb;
}

textarea {
    min-height: 150px;
    resize: vertical;
}

label {
    display: block;
    font-weight: 700;
    color: #f4ecff;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0 18px;
}

.checkbox-row input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.search-panel {
    margin-top: 22px;
}

.search-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
}

.search-grid .field {
    min-width: 0;
}

.small-note {
    color: var(--text-dim);
    font-size: 0.92rem;
}

.empty-box h2,
.empty-box h3,
.form-box h1,
.form-box h2 {
    margin-top: 0;
}

.message {
    padding: 12px 14px;
    background: rgba(129,247,181,0.12);
    border: 1px solid rgba(129,247,181,0.35);
    color: #dfffea;
    border-radius: 12px;
    margin-bottom: 20px;
}

.error-box {
    min-height: 70vh;
    display: grid;
    place-items: center;
    padding: 30px 0;
}

.error-panel {
    max-width: 760px;
    text-align: center;
}

.error-code {
    font-size: clamp(3rem, 10vw, 6rem);
    margin-bottom: 6px;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    min-width: 780px;
}

.admin-table th,
.admin-table td {
    border: 1px solid rgba(255,255,255,0.14);
    padding: 12px;
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    background: rgba(255,255,255,0.05);
}

.thumb-preview {
    max-width: 200px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.14);
}

.gallery-admin-item {
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.14);
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    background: rgba(8, 5, 15, 0.92);
    padding: 20px;
}

.lightbox.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-inner {
    max-width: min(1100px, 100%);
    max-height: 100%;
    position: relative;
}

.lightbox-img {
    max-width: 100%;
    max-height: 82vh;
    border-radius: 16px;
    border: 2px solid rgba(109,230,255,0.28);
    box-shadow: var(--shadow);
}

.lightbox-caption {
    margin-top: 12px;
    text-align: center;
    color: #f1eaff;
}

.lightbox-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 0;
    font-size: 1.3rem;
    cursor: pointer;
    background: linear-gradient(180deg, #ff7b90, #ff4d6d);
    color: #fff;
    box-shadow: var(--shadow);
}

@media (max-width: 980px) {
    .grid,
    .gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .console-layout {
        grid-template-columns: 1fr;
    }

    .search-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 720px) {
    .site-header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .top-nav {
        width: 100%;
    }

    .top-nav a {
        flex: 1 1 auto;
        text-align: center;
    }

    .search-grid {
        grid-template-columns: 1fr;
    }

    .button,
    button,
    input[type="submit"] {
        width: 100%;
    }

    .button-row .button,
    .button-row button {
        width: auto;
    }
}

@media (max-width: 640px) {
    .hero {
        padding-top: 20px;
    }

    .hero-box,
    .panel,
    .form-box,
    .empty-box,
    .detail-box,
    .light-panel {
        padding: 18px;
        border-radius: 18px;
    }

    .grid,
    .gallery {
        grid-template-columns: 1fr;
    }

    .card-content {
        padding: 16px;
    }

    .section-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .logo {
        font-size: 1.1rem;
    }

    .logo-sub {
        letter-spacing: 0.12em;
    }

    .console-meta span,
    .badge {
        font-size: 0.82rem;
        padding: 5px 9px;
    }
}