* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.announcement {
    background: linear-gradient(90deg, #ff6b6b, #feca57);
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.announcement p {
    margin: 0;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
}

.upload-section {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.upload-area:hover {
    border-color: #4a90d9;
    background: #f8f9fa;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.upload-area p {
    color: #666;
    font-size: 16px;
}

#file-input {
    display: none;
}

.upload-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.upload-controls select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #333;
    min-width: 150px;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #5a6268;
}

.admin-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.btn {
    padding: 10px 25px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(90deg, #4a90d9, #357abd);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 144, 217, 0.4);
}

.btn-danger {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
    color: #fff;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.category-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 25px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: #fff;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: #4a90d9;
    color: #fff;
    border-color: #4a90d9;
}

.tab-btn:hover {
    border-color: #4a90d9;
    color: #4a90d9;
}

.tab-btn.active:hover {
    color: #fff;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.gallery-item {
    position: relative;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.gallery-item .number {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #e74c3c;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.gallery-item.selected {
    border: 3px solid #4a90d9;
}

.gallery-item.selected::before {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: #4a90d9;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.checkbox {
    display: none;
}

.admin-mode .checkbox {
    display: block;
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    z-index: 10;
}

.admin-mode .checkbox.checked {
    background: #4a90d9;
    border-color: #4a90d9;
}

.admin-mode .checkbox.checked::after {
    content: '✓';
    color: #fff;
    font-size: 12px;
    position: absolute;
    top: 2px;
    left: 4px;
}

.delete-btn {
    display: none;
}

.admin-mode .delete-btn {
    display: block;
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(231, 76, 60, 0.9);
    color: #fff;
    border: none;
    padding: 5px 15px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    z-index: 10;
}

.loading {
    text-align: center;
    padding: 50px;
    color: #999;
}

.footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.footer p {
    color: #999;
    font-size: 14px;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.modal-content h2 {
    color: #333;
    margin-bottom: 20px;
}

.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 0;
}

.preview-content {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-content img {
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.preview-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 32px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.preview-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.3);
    pointer-events: none;
    user-select: none;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

#save-original-btn {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 20px;
}

.modal-content button {
    background: #4a90d9;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

.close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
}

.mode-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #999;
    color: #fff;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 100;
}

.mode-indicator.admin {
    background: #4a90d9;
}

.mode-toggle {
    position: fixed;
    bottom: 30px;
    right: 20px;
    background: #4a90d9;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(74, 144, 217, 0.4);
}

@media (max-width: 768px) {
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
    
    .gallery-item img {
        height: 140px;
    }
    
    .upload-controls {
        flex-direction: column;
    }
    
    .upload-controls select,
    .btn {
        width: 100%;
    }
    
    .header h1 {
        font-size: 22px;
    }
}