* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'SimHei', Arial, sans-serif;
    background: linear-gradient(135deg, #DC143C 0%, #8B0000 100%);
    min-height: 100vh;
    padding: 20px;
}

.admin-container {
    max-width: 900px;
    margin: 0 auto;
    background: linear-gradient(180deg, #FFF8DC 0%, #FFFACD 100%);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(139, 0, 0, 0.4);
    overflow: hidden;
    border: 3px solid #FFD700;
}

.admin-header {
    background: linear-gradient(135deg, #DC143C 0%, #B22222 100%);
    color: #FFD700;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #FFD700;
    position: relative;
}

.admin-header::before {
    content: '🎉';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
}

.admin-header h1 {
    margin: 0;
    font-size: 1.8rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.back-link {
    color: #FFD700;
    text-decoration: none;
    padding: 10px 20px;
    background: rgba(220, 20, 60, 0.3);
    border: 2px solid #FFD700;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-weight: bold;
}

.back-link:hover {
    background: rgba(220, 20, 60, 0.5);
    transform: translateX(-5px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.admin-content {
    padding: 30px;
}

.config-section {
    background: linear-gradient(180deg, #FFF8DC 0%, #FFFACD 100%);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    border: 2px solid #FFD700;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
}

.config-section h2 {
    color: #DC143C;
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.section-desc {
    color: #8B0000;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.emoji-selector {
    margin-top: 15px;
}

.emoji-selector label {
    display: block;
    font-weight: bold;
    color: #495057;
    margin-bottom: 10px;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.emoji-item {
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.emoji-item:hover {
    border-color: #667eea;
    transform: scale(1.1);
}

.emoji-item.selected {
    background: #667eea;
    border-color: #667eea;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.multi-select .emoji-item.selected {
    background: #28a745;
    border-color: #28a745;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.image-selector {
    margin-top: 15px;
}

.image-selector label {
    display: block;
    font-weight: bold;
    color: #495057;
    margin-bottom: 10px;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.image-item {
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.image-item:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

.image-item.selected {
    background: #667eea;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.multi-select .image-item.selected {
    background: #28a745;
    border-color: #28a745;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.no-images {
    color: #6c757d;
    text-align: center;
    padding: 20px;
    grid-column: 1 / -1;
}

.upload-section {
    margin-top: 15px;
}

.upload-section label {
    display: block;
    font-weight: bold;
    color: #495057;
    margin-bottom: 10px;
}

.file-input {
    width: 100%;
    padding: 10px;
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.file-input:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.image-preview-container {
    margin-top: 15px;
    padding: 15px;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    min-height: 100px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.image-preview-container.multi {
    min-height: 150px;
}

.image-preview {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    display: none;
}

.image-preview-wrapper {
    position: relative;
    display: inline-block;
}

.image-preview-wrapper .image-preview {
    display: block;
}

.remove-image-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #dc3545;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.remove-image-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.preview-placeholder {
    color: #6c757d;
    font-size: 0.95rem;
    text-align: center;
    width: 100%;
}

.preview-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    display: none;
}

.selected-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 10px;
}

.selected-preview span:first-child {
    font-weight: bold;
    color: #495057;
    min-width: 80px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 10px;
    border: 2px solid #dee2e6;
}

.setting-row label {
    font-weight: bold;
    color: #495057;
}

.setting-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.btn {
    padding: 15px 40px;
    font-size: 1.1rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-save {
    background: linear-gradient(135deg, #DC143C 0%, #B22222 100%);
    color: #FFD700;
    border: 2px solid #FFD700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-save:hover {
    box-shadow: 0 6px 20px rgba(220, 20, 60, 0.5);
}

.btn-reset {
    background: linear-gradient(135deg, #8B0000 0%, #DC143C 100%);
    color: #FFD700;
    border: 2px solid #FFD700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-reset:hover {
    box-shadow: 0 6px 20px rgba(139, 0, 0, 0.5);
}

.btn-modal {
    background: linear-gradient(135deg, #DC143C 0%, #B22222 100%);
    color: #FFD700;
    border: 2px solid #FFD700;
    margin-top: 20px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-modal:hover {
    box-shadow: 0 6px 20px rgba(220, 20, 60, 0.5);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    border: 3px solid #667eea;
    animation: modalPop 0.3s ease;
}

@keyframes modalPop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.modal-message {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .admin-container {
        margin: 0;
        border-radius: 0;
    }

    .admin-header {
        padding: 20px;
        flex-direction: column;
        gap: 15px;
    }

    .admin-header h1 {
        font-size: 1.4rem;
    }

    .admin-content {
        padding: 20px;
    }

    .config-section {
        padding: 20px;
    }

    .image-preview {
        width: 80px;
        height: 80px;
    }

    .emoji-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        gap: 8px;
    }

    .emoji-item {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}