       /* ----- Reset & Base ----- */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
            background: #f5f7fb;
            color: #1e293b;
            padding: 24px;
            display: flex;
            flex-direction: column;
            min-height: 100vh;
        }
        .container {
            max-width: 1200px;
            margin: 0 auto;
            flex: 1;
            width: 100%;
        }
        /* ----- Header ----- */
        .site-header {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 16px;
            flex-wrap: wrap;
        }
        .site-logo {
            height: 40px;
            width: auto;
            flex-shrink: 0;
            display: block;
        }
        .site-title {
            font-size: 28px;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }
        .site-title small {
            font-size: 16px;
            font-weight: 400;
            color: #64748b;
        }
        .site-title a {
            color: #3b82f6;
            text-decoration: none;
        }
        .site-title a:hover {
            text-decoration: underline;
        }
        /* ----- Upload Area ----- */
        .upload-area {
            background: #fff;
            border: 2px dashed #cbd5e1;
            border-radius: 16px;
            padding: 40px 20px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-bottom: 30px;
            position: relative;
            min-height: 200px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }
        .upload-area:hover {
            border-color: #3b82f6;
            background: #f8fafc;
        }
        .upload-area.dragover {
            border-color: #3b82f6;
            background: #eff6ff;
            transform: scale(1.01);
        }
        .upload-area .icon {
            font-size: 48px;
            display: block;
            margin-bottom: 8px;
        }
        .upload-area h3 {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 6px;
        }
        .upload-area p {
            color: #64748b;
            font-size: 14px;
        }
        .upload-area input[type="file"] {
            display: none;
        }
        .upload-area .uploading-overlay {
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            position: absolute;
            inset: 0;
            background: rgba(255, 255, 255, 0.85);
            border-radius: 16px;
            z-index: 5;
        }
        .upload-area.uploading .uploading-overlay {
            display: flex;
        }
        .upload-area.uploading .upload-content {
            opacity: 0.3;
            pointer-events: none;
        }
        .upload-area .spinner {
            width: 48px;
            height: 48px;
            border: 4px solid #e2e8f0;
            border-top-color: #3b82f6;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
            margin-bottom: 12px;
        }
        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }
        .upload-area .uploading-text {
            font-size: 16px;
            font-weight: 500;
            color: #1e293b;
        }
        .upload-area .uploading-progress {
            font-size: 14px;
            color: #475569;
            margin-top: 4px;
        }
        /* ----- Toolbar ----- */
        .toolbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            flex-wrap: wrap;
            gap: 12px;
        }
        .toolbar .info {
            font-size: 15px;
            color: #475569;
        }
        .toolbar .info strong {
            color: #0f172a;
        }
        .btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 8px 18px;
            border: none;
            border-radius: 30px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            background: #e2e8f0;
            color: #1e293b;
        }
        .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        }
        .btn-danger {
            background: #fee2e2;
            color: #b91c1c;
        }
        .btn-danger:hover {
            background: #fecaca;
        }
        .btn-sm {
            padding: 4px 12px;
            font-size: 12px;
        }
        .btn-primary {
            background: #3b82f6;
            color: #fff;
        }
        .btn-primary:hover {
            background: #2563eb;
        }
        .btn-primary:disabled {
            opacity: 0.4;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }
        .btn-success {
            background: #22c55e;
            color: #fff;
        }
        .btn-success:hover {
            background: #16a34a;
        }
        .btn-group {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }
        /* ----- Gallery ----- */
        .gallery {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 20px;
        }
        .card {
            background: #fff;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
            transition: all 0.3s ease;
        }
        .card:hover {
            transform: translateY(-6px);
            box-shadow: 0 12px 28px rgba(0, 0, 0, 0.10);
        }
        .card .media-wrapper {
            width: 100%;
            padding-top: 100%;
            position: relative;
            background: #f1f5f9;
            overflow: hidden;
            cursor: pointer;
        }
        .card .media-wrapper img,
        .card .media-wrapper video {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .card .media-wrapper .play-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            pointer-events: none;
            background: rgba(0, 0, 0, 0.15);
            transition: background 0.3s;
        }
        .card .media-wrapper .play-overlay .play-icon {
            font-size: 48px;
            color: #fff;
            text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
            opacity: 0.8;
            transition: transform 0.2s, opacity 0.2s;
            line-height: 1;
        }
        .card:hover .media-wrapper .play-overlay .play-icon {
            transform: scale(1.1);
            opacity: 1;
        }
        .card .media-wrapper .thumbnail-fallback {
            display: none;
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            align-items: center;
            justify-content: center;
            background: #1e293b;
            color: #94a3b8;
            font-size: 48px;
        }
        .card .media-wrapper img.error+.thumbnail-fallback {
            display: flex;
        }
        .card .info {
            padding: 12px 14px;
            font-size: 13px;
        }
        .card .info .name {
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            cursor: pointer;
        }
        .card .info .name:hover {
            color: #3b82f6;
        }
        .card .info .meta {
            color: #64748b;
            font-size: 12px;
            margin-top: 4px;
            display: flex;
            justify-content: space-between;
        }
        .card .actions {
            display: flex;
            justify-content: flex-end;
            padding: 4px 14px 12px;
            gap: 6px;
        }
        .empty {
            grid-column: 1 / -1;
            text-align: center;
            padding: 60px 20px;
            color: #94a3b8;
        }
        .empty .big {
            font-size: 64px;
            display: block;
            margin-bottom: 12px;
        }
        /* ----- Pagination ----- */
        .pagination {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 16px;
            margin-top: 28px;
            padding: 12px 0;
        }
        .pagination .page-info {
            font-size: 15px;
            color: #475569;
            min-width: 100px;
            text-align: center;
        }
        /* ----- Modal ----- */
        .modal {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(6px);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 999;
            padding: 30px;
        }
        .modal.active {
            display: flex;
        }
        .modal-content {
            max-width: 90vw;
            max-height: 90vh;
            background: #fff;
            border-radius: 16px;
            overflow: hidden;
            position: relative;
            display: flex;
            flex-direction: column;
        }
        .modal-content .modal-media {
            display: flex;
            justify-content: center;
            align-items: center;
            background: #000;
            width: 100%;
            cursor: pointer;
        }
        .modal-content .modal-media img,
        .modal-content .modal-media video {
            display: block;
            max-width: 100%;
            max-height: 85vh;
            margin: 0 auto;
        }
        .modal-content .modal-media video {
            width: 100%;
            height: auto;
        }
        .modal-close {
            position: absolute;
            top: 12px;
            right: 16px;
            background: rgba(0, 0, 0, 0.5);
            color: #fff;
            border: none;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            font-size: 24px;
            cursor: pointer;
            transition: all 0.2s;
            z-index: 10;
            display: flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
        }
        .modal-close:hover {
            background: rgba(0, 0, 0, 0.8);
            transform: rotate(90deg);
        }
        .modal-info {
            padding: 14px 20px;
            background: #f8fafc;
            font-size: 14px;
            display: flex;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 6px;
        }
        /* ----- Toast ----- */
        .toast-container {
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 9999;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .toast {
            padding: 12px 20px;
            border-radius: 10px;
            background: #0f172a;
            color: #fff;
            font-size: 14px;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.20);
            animation: slideIn 0.3s ease;
        }
        .toast.success {
            background: #166534;
        }
        .toast.error {
            background: #991b1b;
        }
        .toast.info {
            background: #1e40af;
        }
        @keyframes slideIn {
            from {
                transform: translateX(60px);
                opacity: 0;
            }
            to {
                transform: translateX(0);
                opacity: 1;
            }
        }
        /* ----- FAQ / How-to (collapsible) ----- */
        .help-section {
            margin-top: 40px;
            border-top: 1px solid #e2e8f0;
            padding-top: 24px;
        }
        .help-section details {
            background: #fff;
            border-radius: 12px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
            margin-bottom: 12px;
            padding: 6px 16px 6px 16px;
            transition: all 0.2s;
        }
        .help-section details summary {
            font-weight: 600;
            font-size: 17px;
            cursor: pointer;
            padding: 10px 0;
            color: #0f172a;
            outline: none;
            list-style: none;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .help-section details summary::-webkit-details-marker {
            display: none;
        }
        .help-section details summary::before {
            content: "▶";
            font-size: 14px;
            transition: transform 0.2s;
            color: #3b82f6;
        }
        .help-section details[open] summary::before {
            transform: rotate(90deg);
        }
        .help-section details .content {
            padding: 6px 0 18px 0;
            color: #334155;
            line-height: 1.7;
            font-size: 15px;
        }
        .help-section details .content p {
            margin-bottom: 10px;
        }
        .help-section details .content ul {
            padding-left: 20px;
            margin: 8px 0 12px 0;
        }
        .help-section details .content ul li {
            margin-bottom: 4px;
        }
        .help-section details .content strong {
            color: #0f172a;
        }
        /* ----- Footer ----- */
        .footer {
            margin-top: 48px;
            padding: 28px 0 12px;
            border-top: 1px solid #e2e8f0;
            text-align: center;
            color: #64748b;
            font-size: 14px;
            line-height: 1.7;
        }
        .footer .copyright {
            margin-bottom: 6px;
        }
        .footer .copyright a {
            color: #1e293b;
            text-decoration: none;
            font-weight: 500;
            transition: color 0.2s;
        }
        .footer .copyright a:hover {
            color: #3b82f6;
            text-decoration: underline;
        }
        .footer .footer-links {
            display: flex;
            justify-content: center;
            flex-wrap: wrap;
            gap: 4px 18px;
            margin-top: 4px;
        }
        .footer .footer-links a {
            color: #64748b;
            text-decoration: none;
            transition: color 0.2s;
        }
        .footer .footer-links a:hover {
            color: #3b82f6;
            text-decoration: underline;
        }
        .footer .footer-links .link-divider {
            color: #cbd5e1;
            user-select: none;
        }
        /* ----- Responsive ----- */
        @media (max-width: 640px) {
            body {
                padding: 12px;
            }
            .site-header {
                gap: 8px;
            }
            .site-logo {
                height: 32px;
            }
            .site-title {
                font-size: 20px;
                gap: 6px;
            }
            .site-title small {
                font-size: 14px;
            }
            .gallery {
                grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
                gap: 14px;
            }
            .upload-area {
                padding: 28px 16px;
                min-height: 160px;
            }
            .upload-area .icon {
                font-size: 36px;
            }
            .modal-content {
                max-width: 98vw;
                max-height: 80vh;
            }
            .pagination {
                gap: 10px;
            }
            .pagination .page-info {
                font-size: 13px;
                min-width: 80px;
            }
            .btn {
                padding: 6px 14px;
                font-size: 13px;
            }
            .footer {
                margin-top: 32px;
                padding-top: 20px;
                font-size: 13px;
            }
            .footer .footer-links {
                gap: 4px 12px;
            }
            .toolbar .btn-group {
                justify-content: center;
                flex-wrap: wrap;
            }
            .help-section details summary {
                font-size: 15px;
            }
        }
        @media (max-width: 400px) {
            .gallery {
                grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
                gap: 10px;
            }
            .pagination {
                flex-wrap: wrap;
                gap: 6px;
            }
            .site-title {
                font-size: 18px;
            }
            .site-logo {
                height: 28px;
            }
        }