/* 预设背景和贴片选择样式 */

.background-selection, .overlay-selection {
    margin: 15px 0;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.background-selection h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
}

.background-tabs, .overlay-tabs, .duration-tabs {
    display: flex;
    margin-bottom: 0;
    border-bottom: 2px solid #e9ecef;
    background: #f8f9fa;
    padding: 5px;
    border-radius: 8px 8px 0 0;
}

.tab-btn {
    padding: 10px 20px;
    border: 2px solid #e9ecef;
    background: white;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    margin-right: 2px;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab-btn.active {
    color: #007bff;
    background: linear-gradient(135deg, #f8f9ff 0%, #e3f2fd 100%);
    border-color: #007bff;
    font-weight: 600;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
    z-index: 1;
}

.tab-btn:hover:not(.active) {
    color: #007bff;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-color: #007bff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 123, 255, 0.15);
}

.tab-content {
    min-height: 50px;
    background: white;
    border: 2px solid #e9ecef;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: #fff;
}

.preset-item {
    position: relative;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #fff;
}

.preset-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

.preset-item.selected {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.3);
}

.preset-item img {
    width: 100%;
    height: 160px; /* 9:16比例，基于120px宽度计算 */
    object-fit: cover;
    display: block;
}

.preset-item-info {
    padding: 5px;
    background-color: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.preset-filename {
    font-size: 11px;
    color: #666;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-image {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #f8f9fa;
    text-align: center;
}

.preview-image img {
    max-width: 200px;
    max-height: 356px; /* 9:16比例，基于200px宽度计算 */
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.preview-image p {
    margin: 8px 0 0 0;
    font-size: 12px;
    color: #666;
}

.error-message {
    color: #dc3545;
    font-size: 14px;
    text-align: center;
    padding: 20px;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .preset-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .preset-item img {
        height: 133px; /* 9:16比例，基于100px宽度计算 */
    }
    
    .tab-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* 滚动条样式 */
.preset-grid::-webkit-scrollbar {
    width: 6px;
}

.preset-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.preset-grid::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.preset-grid::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

